Affirmations.dev API
Free affirmations API with no key: returns a random positive affirmation as a one-field JSON object. Minimal payload, ideal for wellbeing apps. Tested.
Endpoint tested and returned HTTP 200 on 20 Aug 2026
What is the Affirmations.dev API?
Affirmations.dev is a free, key-free API that returns a random positive affirmation as a JSON object with a single `affirmation` field.
This is about as small as a useful API gets: one endpoint, no parameters, one field. It serves short positive statements intended for wellbeing and mindfulness applications.
The minimal surface makes it a good teaching example, and a genuinely practical one for daily-prompt features where you want fresh copy without writing and maintaining it yourself.
Quick facts
- Base URL
https://www.affirmations.dev- Authentication
- No API key required.
- Rate limit
- No published limit.
- Pricing
- Free and open source.
- CORS
- Not enabled — call it from your server
- Official docs
- Read the docs
How to use the Affirmations.dev API
Every request below was executed against the live API on 20 Aug 2026, and the response shown is the real body it returned — not an illustration.
1. Fetch a random affirmation
GET https://www.affirmations.dev/
curl 'https://www.affirmations.dev/'const res = await fetch("https://www.affirmations.dev/");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://www.affirmations.dev/", timeout=20)
res.raise_for_status()
print(res.json()){
"affirmation": "The path to success is to take massive, determined action"
}Response fields
affirmationstring- The affirmation text. That is the entire response.
What you can build with the Affirmations.dev API
- Add a daily affirmation to a wellbeing or journaling app
- Display an encouraging message on a dashboard
- Build a mindfulness widget or browser extension
- Teach fetch with a minimal, friendly payload
Common errors and how to fix them
Repeated affirmations
The pool is finite.
Fix: Expect repeats over many calls; deduplicate client-side if it matters.
CORS considerations
Check headers before calling from the browser.
Fix: Proxy through your server if the browser blocks it.
Affirmations.dev API — frequently asked questions
Is the Affirmations API free?
Yes, completely free and open source with no API key, rate limit or signup.
What does it return?
A JSON object with a single `affirmation` field containing a short positive statement. There is nothing else.
Can I filter by category or mood?
No, it has one endpoint with no parameters. For categorised content you would need a different service or your own curated set.
Is it suitable for a production wellbeing app?
For a light daily-prompt feature, yes. If affirmations are core to your product you would want your own curated content rather than depending on a third party.
Tools that pair with this API
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
Word Counter
Count words, characters, sentences, paragraphs and estimated reading time instantly. Free online word counter for essays, blogs and social media.
Alternatives to Affirmations.dev API
If Affirmations.dev does not fit, these entertainment apis cover similar ground. Every one was called before publishing, and each links to its own reference page with a working curl command and the response it returned.
| API | What it does | Auth | CORS | Last verified |
|---|---|---|---|---|
| Official Joke API | Free joke API with no key: random jokes with setup and punchline, filterable by type. Perfect for beginner projects. Tested curl example and live JSON. | No key | Yes | 19 Aug 2026 |
| icanhazdadjoke | Free dad joke API with no key. Returns jokes as JSON, plain text or image depending on the Accept header. Search supported. Tested curl example included. | No key | Yes | 19 Aug 2026 |
| chucknorris.io | Free Chuck Norris jokes API with no key. Random jokes, 16 categories and full-text search. CORS enabled. Tested curl example and live JSON response. | No key | Yes | 19 Aug 2026 |
| Advice Slip | Free advice API with no key. Returns random advice slips as JSON, with search and id lookup. CORS enabled. Tested curl example and live response. | No key | Yes | 19 Aug 2026 |
| Animechan | Animechan is a free anime quotes API with no key: random quotes plus queryable anime and character indexes, so you can filter rather than only shuffle. Live example included. | No key | Yes | 21 Aug 2026 |
| Corporate BS Generator | Free corporate buzzword API with no key: generates plausible business jargon phrases. Useful for placeholder copy and demo data. Tested curl example. | No key | No | 20 Aug 2026 |
Affirmations.dev is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 20 Aug 2026; always check the official documentation before relying on this API in production, as terms and limits can change.