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 2026-08-20
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 2026-08-20, 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.
Affirmations.dev is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-20; always check the official documentation before relying on this API in production, as terms and limits can change.