API Directory › 🎉 Fun & Random › Affirmations
No authHTTPSCORS

Affirmations API

Random positive affirmations from a simple free API — no key.

Auth
No auth needed
HTTPS
Yes
CORS
Yes
Open Affirmations docs ↗

What it does

affirmations.dev is a tiny API that returns a single random positive affirmation. One endpoint, no parameters, CORS enabled.

Base URL

https://www.affirmations.dev

Authentication

None. GET / returns {"affirmation": "..."}.

Code examples

curl
curl -s https://www.affirmations.dev/
JavaScript
const { affirmation } = await fetch("https://www.affirmations.dev/")
  .then(r => r.json());
document.querySelector("#msg").textContent = affirmation;

Rate limits & quotas

No key, no documented rate limit. The affirmation pool is finite, so expect repeats over many calls. Cache one per session or per day rather than fetching on every render.

Key response fields

affirmationThe affirmation text

Common errors

5xxRare — retry or show a bundled fallback affirmation.
(repeats)Small dataset — not a bug.

When to use it (and alternatives)

A gentle touch for wellness apps, new-tab pages, journaling tools and loading screens. See also Advice Slip and ZenQuotes for related short-text content.

FAQ

Does it work from the browser?

Yes — CORS is enabled, so a direct fetch works with no proxy.

Can I get several at once?

No — it returns one affirmation per call. Loop if you need a few, or cache a batch.

Is it actively maintained?

It is a small community project. Add a local fallback list so your feature still works if the service is down.

New to APIs?

Short guides for working with this API — and any other.

🛠️ Handy LarzOS tools

Free tools to help you work with this API.

JSON Formatter

Related Fun & Random APIs

← Back

More Fun & Random APIs · All 196 APIs