Advice Slip API
Random pieces of advice served as JSON — free and no key.
What it does
The Advice Slip API returns a random piece of (often tongue-in-cheek) advice, a specific slip by id, or the results of a keyword search across the advice database.
Base URL
Authentication
None. /advice (random), /advice/{id}, /advice/search/{query}.
Code examples
curl -s https://api.adviceslip.com/advice curl -s https://api.adviceslip.com/advice/search/money
const { slip } = await fetch("https://api.adviceslip.com/advice").then(r => r.json());
console.log(slip.advice);Rate limits & quotas
No key. The random endpoint is cached for a couple of seconds per client, so calling it in a tight loop returns the same slip — add a cache-buster query param or just wait. No hard rate limit documented.
Key response fields
| slip.id | The slip’s id |
| slip.advice | The advice text |
| (search) slips[] | Array of matching slips |
| (search) total_results | Number of matches (as a string) |
| message.text | Present instead of slips when a search finds nothing |
Common errors
| (search miss) | Returns {"message": {"type": "notice", "text": "No advice slips found..."}} — not an HTTP error. |
| (same result repeatedly) | The 2-second cache on /advice — append ?t=Date.now(). |
| 500 | Rare — retry. |
When to use it (and alternatives)
A one-line filler for a ‘random advice’ button, a CLI fortune command or a loading screen. Similar tiny text APIs: Affirmations, Useless Facts, ZenQuotes.
FAQ
Why do I keep getting the same advice?
The /advice endpoint is cached ~2 seconds per client. Add a unique query parameter (?t=timestamp) or space your calls out.
How does search work?
/advice/search/{query} does a substring match and returns a slips array. If nothing matches you get a message object instead — check which key is present.
Is there a total count of slips?
Not exposed directly, but ids are roughly sequential, so /advice/{n} for increasing n lets you walk the set.
New to APIs?
Short guides for working with this API — and any other.