ZenQuotes API
Free inspirational quotes API with random and quote-of-the-day endpoints.
What it does
ZenQuotes is an inspirational-quotes API: a random quote, the ‘quote of the day’, a batch of 50 random quotes, and (paid) quotes by keyword or author. Responses are a small JSON array.
Base URL
Authentication
None for the free endpoints (/random, /today, /quotes). Free use requires attribution — a visible hyperlink to zenquotes.io near where you display the quote. An API key (paid) removes attribution and rate limits and unlocks keyword/author search.
Code examples
curl -s https://zenquotes.io/api/random curl -s https://zenquotes.io/api/today
import requests
q = requests.get("https://zenquotes.io/api/random", timeout=10).json()[0]
print(f'"{q["q"]}" - {q["a"]}')Rate limits & quotas
Free tier: 5 requests per 30 seconds per IP — over that, the array contains a single object whose q is a ‘too many requests’ message. The /quotes endpoint returns 50 at once, so fetch a batch and rotate through it client-side rather than calling /random repeatedly.
Key response fields
| [].q | The quote text |
| [].a | The author |
| [].h | Pre-formatted HTML blockquote (includes the required attribution when used as-is) |
| [].c | Character count (some endpoints) |
Common errors
| (rate-limit sentinel) | A 200 response whose q reads ‘Too many requests. Obtain an auth key...’ — you exceeded 5/30s. |
| (missing attribution) | Not an API error, but a terms violation on the free tier — show the zenquotes.io link. |
| 429 | Sometimes returned instead of the sentinel — treat both as ‘back off’. |
When to use it (and alternatives)
A quick hosted option for quote-of-the-day features and motivational widgets, as long as you can show the attribution link. If you need to avoid the backlink or want topic filtering without paying, self-host Quotable.
FAQ
Why does my quote say 'Too many requests'?
The free limit is 5 requests per 30 seconds per IP. Call /quotes once for 50 quotes and cycle through them, or cache /today for the day.
Do I have to link back to ZenQuotes?
Yes, on the free tier — a visible hyperlink to zenquotes.io is required. Using the provided h (HTML) field verbatim satisfies this.
Can I search quotes by topic?
Only with a paid API key (/keyword/{word}, /author/{name}). The free endpoints are random / today / batch only.
New to APIs?
Short guides for working with this API — and any other.