Advice Slip

Fun API · Random advice · Searchable database · No key

TL;DR

Advice Slip dishes out bite-sized nuggets of wisdom on demand. Each call returns a random piece of advice as a JSON "slip" with a unique ID and the advice text. You can also search the database by keyword to find relevant advice. It covers everything from career and relationships to productivity and life philosophy — like having a fortune cookie machine as an API.

Quick start: https://api.adviceslip.com/advice

No API key needed — just make a request!

How to Use This API

1. Random Advice

https://api.adviceslip.com/advice

Returns: {"slip":{"id":147,"advice":"Don't feed bread to ducks. Feed them peas, corn, or oats."}}

2. Search Advice by Keyword

https://api.adviceslip.com/advice/search/love

Searches the full advice text for "love". Returns all matching slips. If no matches: {"message":"No advice slips found matching 'love'"}

3. Get Advice by ID

https://api.adviceslip.com/advice/42

Fetch a specific slip by its ID. Useful if you want to bookmark or reference a particular piece of advice.

4. JavaScript — Random Advice Widget

async function getAdvice() {
  const resp = await fetch('https://api.adviceslip.com/advice');
  const data = await resp.json();
  return data.slip;
}

async function searchAdvice(query) {
  const resp = await fetch(
    `https://api.adviceslip.com/advice/search/${encodeURIComponent(query)}`
  );
  return resp.json();
}

// Show a random advice every 5 seconds
setInterval(async () => {
  const { advice } = await getAdvice();
  console.log('💡', advice);
}, 5000);

5. Python — Search and Display

import requests

def random_advice():
    resp = requests.get('https://api.adviceslip.com/advice')
    return resp.json()['slip']['advice']

def search_advice(keyword):
    resp = requests.get(
        f'https://api.adviceslip.com/advice/search/{keyword}'
    )
    if resp.status_code == 200:
        slips = resp.json()['slips']
        return [s['advice'] for s in slips]
    return []

# Search for career advice
results = search_advice('career')
for a in results:
    print(f"• {a}")

print(f"\nRandom: {random_advice()}")
Try random advice: https://api.adviceslip.com/advice

Frequently Asked Questions

How many advice slips are in the database?
Hundreds of curated advice slips covering topics from personal finance ("Pay yourself first") to relationships ("Listen more than you speak") to productivity ("Eat that frog").
Can I filter advice by category?
There's no direct category filter, but the search endpoint effectively serves as one. Search for "money" for financial advice, "health" for wellness tips, "work" for career advice.
Why does the API sometimes return no results for a search?
The search is exact keyword matching on the advice text. If your keyword doesn't appear in any slip, you'll get a 404-style message. Try synonyms or more general terms.
Does the API have a rate limit?
No documented rate limit, but the service is free and should be used reasonably. The API has been reliably running for years.
Can I use advice slips in a commercial product?
Yes, the API is free for any use including commercial. The advice is original content, so attribution isn't required but is appreciated.
Is there a way to get a random advice from a specific ID range?
Not directly. The random endpoint picks uniformly from all slips. If you want curated selections, consider using the search endpoint to filter.

API Details

API URL
https://api.adviceslip.com
Documentation
api.adviceslip.com
Category
Fun
Authentication
Not Required
Geographic Coverage
Global

What You Can Build