Advice Slip JSON API
The Advice Slip JSON API is provided for free. 😎 It currently gives out over 10 million pieces of advice every year. If you would like to say thank-you to the creator, then please buy them a coffee or beer! ☕️🍺
Random advice
Note: Advice is cached for 2 seconds. Any repeat-request within 2 seconds will return the same piece of advice.
HTTP Method | GET |
---|---|
URL | https://api.adviceslip.com/advice |
Description | Returns a random advice slip as a slip object. |
Parameters |
|
Advice by ID
HTTP Method | GET |
---|---|
URL | https://api.adviceslip.com/advice/{slip_id} |
Description | If an advice slip is found with the corresponding {slip_id}, a slip object is returned. |
Parameters |
|
Searching advice
HTTP Method | GET |
---|---|
URL | https://api.adviceslip.com/advice/search/{query} |
Description | If an advice slip is found, containing the corresponding search term in {query}, an array of slip objects is returned inside a search object. |
Parameters |
|
Messages
In the event of an error occuring, a message object is returned, containing relevant information about the request.
Slip object
A slip object is a simple piece of advice.
Name | Type | |
---|---|---|
slip_id | integer | The unique ID of this advice slip. |
advice | string | The advice being given. |
{ "slip": { "slip_id": "2", "advice": "Smile and the world smiles with you. Frown and you're on your own." } }
Search object
A search object contains the results of a slip search query.
Name | Type | |
---|---|---|
total_results | integer | Total number of matching advice slips found. |
query | integer | The search query provided. |
slips | string | An array of slip objects matching the search query. |
{ "total_results": "2", "slips": [ { "advice": "Remember that spiders are more afraid of you, than you are of them." }, { "advice":"Smile and the world smiles with you. Frown and you're on your own." } ] }
Message object
A messages object contains information about the status of the requested API URL.
Name | Type | |
---|---|---|
type | string | The type of messages. Can be either noticed, warning or error. |
text | string | The messages being received. |
{ "message": { "type": "notice", "text": "Advice slip not found." } }
RSS
RSS feeds allow for easy access and sharing of advice slips.
Daily Advice Slip
URL | https://api.adviceslip.com/daily_adviceslip.rss |
---|---|
Description | This feed provides a single piece of advice, chosen at random daily, in a simple RSS 2.0 format. |
Berg Little Printer
If you're lucky enough to own a Little Printer, Advice Slip has required the API endpoints available for you to subscribe to daily advice slips.
There is also a sample edition to view online.