Affirmations.dev

Entertainment API · Positive affirmations · Motivation · Mindfulness

TL;DR

Affirmations.dev is the web's simplest positive affirmation API. Hit a single endpoint and get back a random uplifting affirmation as JSON. No authentication, no parameters, no rate limits — just encouragement. Response format: {"affirmation": "..."}. Perfect for adding positivity to your apps, dashboards, terminal prompts, or smart home displays.

Quick start: https://www.affirmations.dev/

No API key needed — free daily positivity!

How to Use This API

1. Get a Random Affirmation

Returns a JSON object with a single affirmation:

https://www.affirmations.dev/

2. JavaScript — Display on Your Website

fetch('https://www.affirmations.dev/')
  .then(r => r.json())
  .then(data => {
    document.getElementById('affirmation').textContent = data.affirmation;
  })
  .catch(() => {
    document.getElementById('affirmation').textContent = 'You are doing great!';
  });

3. Python — Terminal Motivation

import requests

try:
    resp = requests.get('https://www.affirmations.dev/')
    affirmation = resp.json()['affirmation']
    print()
    print('★ Today\'s Affirmation ★')
    print(f'  "{affirmation}"')
    print()
except Exception as e:
    print('★ Belive in yourself! ★')

4. Shell — One-liner for .bashrc

curl -s https://www.affirmations.dev/ | python3 -c "import sys,json; print(json.load(sys.stdin)['affirmation'])"
Get affirmation: https://www.affirmations.dev/

Frequently Asked Questions

How many affirmations are in the database?
The API draws from a collection of 50+ carefully crafted positive affirmations covering themes like self-worth, perseverance, growth mindset, and confidence.
Can I get the same affirmation twice?
Yes — the affirmation is chosen randomly from the database. Getting the same one twice is possible. There is no deduplication or session tracking.
Is there a way to get a specific type of affirmation?
The API is intentionally simple — just one endpoint, no parameters. It always returns a random affirmation. There are no filters or categories.
Can I use this in production?
Absolutely! The API is free, always available, and has no rate limits. It's used in dashboards, terminal prompts, meditation apps, and smart displays worldwide.
What if the API is down?
The API is highly available. If it does fail, add a fallback message like "You are capable of amazing things" to ensure your app still shows encouragement.
Are there any usage limits?
No documented rate limits. The API is extremely lightweight — a single JSON response with one field. Use it as often as you like.

API Details

API URL
https://www.affirmations.dev/
Documentation
affirmations.dev
Category
Entertainment
Authentication
Not Required
Response Format
{"affirmation": "string"}

What You Can Build