TL;DR
What it does: Returns a random piece of advice as JSON.
Quick start: curl "https://api.adviceslip.com/advice"
No API key required – free forever
Overview
The Advice Slip API delivers a random quote of wisdom with each request. The response is tiny (under 200 bytes), making it perfect for micro‑services, chat‑bots, or adding a bit of personality to UI elements. Because it’s completely public, you can call it directly from browsers without dealing with CORS or authentication.
Live Example
Below is the request URL and a real JSON response (captured at the time of page generation).
Sample JSON response:
{
"slip": {
"id": 98,
"advice": "It's always the quiet ones."
}
}
What does the response contain?
- slip.id
- Numeric identifier for the advice entry (useful for caching or referencing a specific slip).
- slip.advice
- The advice text itself – a short, human‑readable string.
Code Samples
JavaScript (Fetch)
fetch('https://api.adviceslip.com/advice')
.then(r => r.json())
.then(data => console.log(data.slip.advice))
.catch(err => console.error('Error fetching advice:', err));
Python (requests)
import requests
resp = requests.get('https://api.adviceslip.com/advice')
advice = resp.json()['slip']['advice']
print('Random advice:', advice)
cURL
# Get a random advice slip
curl "https://api.adviceslip.com/advice"
# Extract only the advice text using jq (if installed)
curl -s "https://api.adviceslip.com/advice" | jq -r '.slip.advice'
Frequently Asked Questions
- Do I need an API key?
- No, the endpoint is public and free.
- Is there a rate limit?
- The API does not publish a strict limit, but excessive rapid requests may be throttled. Cache responses where possible.
- Can I request a specific advice ID?
- Yes – use the endpoint
/advice/:idto retrieve a known slip (e.g.,https://api.adviceslip.com/advice/98). - What format is the response?
- JSON – a top‑level
slipobject withidandadvicefields. - Is CORS enabled?
- Yes – the API can be called directly from browsers.
- Is the content safe for all audiences?
- The advice is community‑generated and generally family‑friendly, but it’s not formally moderated.
API Details
- Base URL
https://api.adviceslip.com- Documentation
- https://api.adviceslip.com/
- Category
- Fun
- Authentication
- None – completely free
- Coverage
- Global – the advice database is the same for all users.
- CORS
- Enabled – can be used directly in web apps.