The Facts API provides tons of random interesting facts about science, literature, philosophy and other cool topics.
Checking API status...
https://api.api-ninjas.com/v1/facts
Returns one (or more) random facts. Free users have access to 100 facts - premium users have access to over 125,000 facts.
limit
optional premium onlyHow many results to return. Must be between 1
and 100
. Default is 1
.
X-Api-Key
requiredAPI Key associated with your account.
https://api.api-ninjas.com/v1/facts
Headers
X-Api-Key
Log in or sign up to get your API Key
1
2
3
4
5
[
{
"fact": "After the Eiffel Tower was built, one person was killed during the installation of the lifts. No one was killed during the actual construction of the tower"
}
]
1
2
curl -X GET "https://api.api-ninjas.com/v1/facts?limit=3" \
-H "X-Api-Key: YOUR_API_KEY"
If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.