At They Said So® we have a huge collection of quotes in our database. And our easy to use REST style Quotes API gives easy way to access the data.
This page is only for high level reference only. For full documentation of the API and to test the API end points from your browser visit https://quotes.rest.
Access Quote of the day in various categories
Search and get quotes based on author, tags, length etc.
Store and retrieve your own private quotes
Create quotes collections (QShow) on various topics
Access curated quotes images or create your own images
Attribution
Note if you are using our public API / quotes from our website an attribution link back to theysaidso.com is required. If you don't want to display attribution please sign up for the private API. Here is the code you can cut and paste to provide attribution.
<span style="z-index:50;font-size:0.9em; font-weight: bold;">
<img src="https://theysaidso.com/branding/theysaidso.png" height="20" width="20" alt="theysaidso.com"/>
<a href="https://theysaidso.com" title="Powered by quotes from theysaidso.com" style="color: #ccc; margin-left: 4px; vertical-align: middle;">
They Said So®
</a>
</span>
Which will translate to something like this in your webpage. Nothing too big. Just a small token of appreciation from you for our service.
If you are using the paid subscription no attribution is required.
API End Points
The end point for connecting, if you subscribe directly from us use this endpoint.
https://quotes.rest/
Authentication
The API's marked as public below can be accessed without any authentication.
Here is an example of requesting an inspiring quote of the day using curl.
curl -v -i -X GET http://quotes.rest/qod.json?category=inspire
For the API's that are private currently we support API Key based authentication. Please set a request header 'X-TheySaidSo-Api-Secret' with value of your API key. Alternatively you can also pass api_key= as a request parameter, though we strongly discourage this mode of passing the key.
Here is an example of requesting for a random quote using curl.
curl -v -i -X GET -H 'X-TheySaidSo-Api-Secret: <your_api_key>' http://quotes.rest/quote/random.json
Here is an example of requesting for a random quote using passing api_key as a parameter.
Want it in JSON format? Just append .json to the query like below. Alternatively you send a http accept header indicating you expect json response. Mashape by default does this so if you are using Mashape the following is not applicable.
GET http://quotes.rest/qod.json
Just append .xml to the query to get the result in XML format.
GET http://quotes.rest/qod.xml
Want it in javascript friendly format. We support JSONP format as well. Append .js to your request.
GET http://quotes.rest/qod.js
Rate Limit
To maintain our service level we rate limit (10 API calls per hour) our public API usage. If you sign up and use the private api key or any of the supported authentication schemes this limit is increased according to the service level of your plan.
Bulk Retrieval
In all the cases our API endpoints return one quotes per call. In certain paid plans bulk retrival of more than one quotes is possible. The following are endpoints that support bulk retrieval. The maximum number of quotes is dependent on the subscribed plan. Please consult the above table for the exact number for each plan.
/qod - QOD - You can get QOD for all the categories by setting parameter "category" to value "all"
/quote/random - You can get more than one quote by setting the parameter "limit" to a numeric value less than or equal to the allowed maximum for your subscribed plan.
/quote/search - You can get more than one quote by setting the parameter "limit" to a numeric value less than or equal to the allowed maximum for your subscribed plan.
var request = URLRequest(url: URL(string: "https://quotes.rest/qod")!)
request.httpMethod = "GET"
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("application/json", forHTTPHeaderField: "Accept")
request.addValue("YOUR API KEY HERE", forHTTPHeaderField: "X-TheySaidSo-Api-Secret")
URLSession.shared.dataTask(with: request, completionHandler: { data, response, error -> Void in
do {
print(data!)
print(response!)
let jsonDecoder = JSONDecoder()
// Access the response here by using json model class
// You can autogenerate Json4Swift_Base swift class below by pasting the JSON response in
// the webpage http://www.json4swift.com
let responseModel = try jsonDecoder.decode(Json4Swift_Base.self, from: data!)
print(responseModel)
} catch {
print("JSON Serialization error")
}
}).resume()
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.net.URL;
import java.net.URLConnection;
import java.net.HttpURLConnection;
public class QuoteOfTheDay {
public static void main(String[] args) throws IOException {
URL url = new URL("https://quotes.rest/qod?category=funny");
try{
//make connection
HttpURLConnection urlc = (HttpURLConnection) url.openConnection();
urlc.setRequestMethod("GET");
// set the content type
urlc.setRequestProperty("Content-Type", "application/json");
urlc.setRequestProperty("X-TheySaidSo-Api-Secret", "YOUR API KEY HERE");
System.out.println("Connect to: " + url.toString());
urlc.setAllowUserInteraction(false);
urlc.connect();
//get result
BufferedReader br = new BufferedReader(new InputStreamReader(urlc.getInputStream()));
String l = null;
while ((l=br.readLine())!=null) {
System.out.println(l);
}
br.close();
} catch (Exception e){
System.out.println("Error occured");
System.out.println(e.toString());
}
}
}
using System;
using System.IO;
using System.Net;
namespace TheySaidSo
{
public class QuoteOfTheDay
{
public static void Main()
{
// Create a request for the URL.
WebRequest request = WebRequest.Create(
"https://quotes.rest/qod?category=inspire");
request.Headers.Add("X-TheySaidSo-Api-Secret", "YOUR API KEY HERE");
// Get the response.
WebResponse response = request.GetResponse();
// Display the status.
// Console.WriteLine(((HttpWebResponse)response).StatusDescription);
// Get the stream containing content returned by the server.
// The using block ensures the stream is automatically closed.
using (Stream dataStream = response.GetResponseStream())
{
// Open the stream using a StreamReader for easy access.
StreamReader reader = new StreamReader(dataStream);
// Read the content.
string responseFromServer = reader.ReadToEnd();
// Display the content.
Console.WriteLine(responseFromServer);
}
// Close the response.
response.Close();
}
}
}
Response
The above calls will result in a response like the following.
{
"success": {
"total": 1
},
"contents": {
"quotes": [
{
"quote": "If you respect yourself in stressful situations, it will help you see the positive… It will help you see the message in the mess.",
"length": "135",
"author": "Steve Maraboli",
"tags": [
"inspire",
"self-respect",
"stress"
],
"category": "inspire",
"language": "en",
"date": "2020-02-02",
"permalink": "https://theysaidso.com/quote/steve-maraboli-if-you-respect-yourself-in-stressful-situations-it-will-help-you",
"id": "nwW3g7V0xszGDNIehz6yTgeF",
"background": "https://theysaidso.com/img/bgs/man_on_the_mountain.jpg",
"title": "Inspiring Quote of the day"
}
]
},
"baseurl": "https://theysaidso.com",
"copyright": {
"year": 2022,
"url": "https://theysaidso.com"
}
}
<?xml version="1.0"?>
<response>
<success>
<total>1</total>
</success>
<contents>
<quotes>
<quote>If you respect yourself in stressful situations, it will help you see the positive… It will help you see the message in the mess.</quote>
<length>135</length>
<author>Steve Maraboli</author>
<tags>inspire</tags>
<tags>self-respect</tags>
<tags>stress</tags>
<category>inspire</category>
<language>en</language>
<date>2020-02-02</date>
<permalink>https://theysaidso.com/quote/steve-maraboli-if-you-respect-yourself-in-stressful-situations-it-will-help-you</permalink>
<id>nwW3g7V0xszGDNIehz6yTgeF</id>
<background>https://theysaidso.com/img/bgs/man_on_the_mountain.jpg</background>
<title>Inspiring Quote of the day</title>
</quotes>
</contents>
<baseurl>https://theysaidso.com</baseurl>
<copyright>
<year>2022</year>
<url>https://theysaidso.com</url>
</copyright>
</response>
parseResponse({
"meta": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,OPTIONS",
"Access-Control-Allow-Headers": "x-access-token",
"X-Auth-Status": "true",
"X-RateLimit-Limit": "10 per hour",
"X-RateLimit-Remaining": "8",
"Cache-Control": "private, max-age=43200, pre-check=86400, post-check=43200",
"Expires": "Mon, 03 Feb 2020 05:51:18 GMT",
"X-Powered-By": "Luracast Restler v3.0.0rc3",
"Content-Type": "text/javascript; charset=utf-8",
"Content-Language": "en-US"
},
"data": {
"success": {
"total": 1
},
"contents": {
"quotes": [
{
"quote": "If you respect yourself in stressful situations, it will help you see the positive… It will help you see the message in the mess.",
"length": "135",
"author": "Steve Maraboli",
"tags": [
"inspire",
"self-respect",
"stress"
],
"category": "inspire",
"language": "en",
"date": "2020-02-02",
"permalink": "https://theysaidso.com/quote/steve-maraboli-if-you-respect-yourself-in-stressful-situations-it-will-help-you",
"id": "nwW3g7V0xszGDNIehz6yTgeF",
"background": "https://theysaidso.com/img/bgs/man_on_the_mountain.jpg",
"title": "Inspiring Quote of the day"
}
]
},
"baseurl": "https://theysaidso.com",
"copyright": {
"year": 2022,
"url": "https://theysaidso.com"
}
}
});
QOD Categories
public
ratelimited
We have more than 15 categories (5 categories published now. 10 categories are being added) for our Quote of the Day service. To get the all the categories in the QOD system, use the following API.
GET http://quotes.rest/qod/categories.json
Here is an example using curl.
curl -v -i -X GET http://quotes.rest/qod/categories.json
QOD for a specific category
public
ratelimited
Here is example of requesting a Management Quote of the day!
GET http://quotes.rest/qod.json?category=management
Here is an example using curl.
curl -v -i -X GET http://quotes.rest/qod.json?category=management
Random Quote
private
ratelimited
Want a random quote from our system? Call the following API.
GET http://quotes.rest/quote/random.json
Quote with length restrictions
private
ratelimited
Want a quote that fits your display profile? You can use any of the following combination to pick the best quote size.
The following returns a quote with at least 100 char length.
GET http://quotes.rest/quote/search.json?minlength=100
The following returns a quote with maximum of 100 char length i.e. 0-100 char length quote.
GET http://quotes.rest/quote/search.json?maxlength=100
The following returns a quote with a length between 100 chars to 300 chars.
GET http://quotes.rest/quote/search.json?minlength=100&maxlength=300
Categories
privateratelimited
We categorize the quotes with tags and we have lot of categories of quotes in our system. To browse the categories in the system, use the following api.
GET http://quotes.rest/quote/categories/popular.json
OR
GET http://quotes.rest/quote/categories/search.json
If you need a random quote from any of the above 500+ categories, just specify the category in you query.
GET http://quotes.rest/quote/search.json?category=<category>
Author
privateratelimited
Our quotes database has quotes from more than 100,000 authors. No where else you have this much variety. You can browse the author names by adjusting the start parameter.
GET http://quotes.rest/quote/authors/popular.json
OR
GET http://quotes.rest/quote/authors/search.json
If you want a random quote by an author, here is how you get it.
GET http://quotes.rest/quote/search.json?author=<author>
Combination Example
GET http://quotes.rest/quote/search?minlength=100&category=<category>&author=<author>
Private Quotes
privateratelimited
You can also programmatically add quotes to our system using our API. Use REST PUT to add a new quote. This will be your private quote in the system.
We have beautiful curated quotes as images. You can access them easily using our API and show them in your websites or Applications. To get a random quote image use the following:
GET http://quotes.rest/quote/image/search.json
Random Quote Image from a category
privateratelimited
To get a random quote image from a particular category use the following:
GET http://quotes.rest/quote/image/search.json?category=<category>
Random Quote Image from an Author
privateratelimited
To get a random quote image from a particular author use the following:
GET http://quotes.rest/quote/image/search.json?author=<author>
API Console
The following are the API calls you can make. You can try out / test the calls right from this page. Please note, javascript needs to be enabled to see the documentation below.