Introduction
Welcome to the What Does Trump Think API! You can use our API get random Trump quotes, or to personalize a Trump quote about a subject of your choosing.
We have language bindings in Shell, Ruby, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
Base URL
https://api.whatdoestrumpthink.com/api/
Use this URL for all requests. All HTTP requests will be redirected over to HTTPS.
Authentication
There is no authentication or authroization for the API; it’s 100% open and free. Please don’t abuse your use.
Legal
By consuming any of the endpoints, you agree to the Terms and Services
Trump Quotes
Get a random Trump Quote
require 'httparty'
require 'json'
req = HTTParty.get('https://api.whatdoestrumpthink.com/api/v1/quotes/random')
JSON.parse(req)
curl "https://api.whatdoestrumpthink.com/api/v1/quotes/random"
$.get("https://api.whatdoestrumpthink.com/api/v1/quotes/random", function(data, status){
return data;
});
The above command returns JSON structured like this:
{
"message": "Your Quote",
"nlp_attributes": {
"quote_structure": "Natural Language Processing Stats"
}
}
This endpoint gets you a random Donald Trump quote. The quote is just a generic quote; it’s not neccesarily about a specific person.
HTTP Request
GET v1/quotes/random
Query Parameters
This query doesn’t accept any parameters.
Get a personalized Trump Quote
require 'httparty'
require 'json'
req = HTTParty.get('https://api.whatdoestrumpthink.com/api/v1/quotes/personalized?q=yourname')
JSON.parse(req)
curl "https://api.whatdoestrumpthink.com/api/v1/quotes/personalized?q=yourname"
$.get("https://api.whatdoestrumpthink.com/api/v1/quotes/personalized?q=yourname", function(data, status){
return data;
});
The above command returns JSON structured like this:
{
"message": "Your Quote",
"nickname": "Your Nickname",
"nlp_attributes": {
"pronoun": "Natural Language Processing best guess for the pronoun",
"quote_structure": "Natural Language Processing Stats"
}
}
This endpoint gets you a personalized Donald Trump quote based upon the input that you give it.
HTTP Request
GET v1/quotes/personalized?q=<YOURNAME>
Query Parameters
Parameter | Type | Description |
---|---|---|
q | string | The name or subject you want a Trump Quote about |
See all Trump Quotes
require 'httparty'
require 'json'
req = HTTParty.get('https://api.whatdoestrumpthink.com/api/v1/quotes/')
JSON.parse(req)
curl "https://api.whatdoestrumpthink.com/api/v1/quotes/"
$.get("https://api.whatdoestrumpthink.com/api/v1/quotes/", function(data, status){
return data;
});
The above command returns JSON structured like this:
{
"messages": {
"personalized": [
"Quote 1",
"Quote 2",
"...",
"Quote N"
],
"non_personalized": [
"Quote 1",
"Quote 2",
"...",
"Quote N"
]
}
}
This endpoint shows all quotes in our database. The quotes are keyed based upon whether they can be said about a specific person (personalized), or if they are generic (non_personalized)
HTTP Request
GET v1/quotes
Query Parameters
This query doesn’t accept any parameters.
Errors
The What Does Trump Think API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request – Your request sucks |
404 | Not Found – The specified path could not be found |
405 | Method Not Allowed – You tried to access a Trump Quote with an invalid method |
406 | Not Acceptable – You requested a format that isn’t json |
410 | Gone – The Trump Quote requested has been removed from our servers |
429 | Too Many Requests – You’re requesting too many Trump Quotes! Slow down! |
500 | Internal Server Error – We had a problem with our server. Try again later. |
503 | Service Unavailable – We’re temporarially offline for maintanance. Please try again later. |