Facts API

The Facts API provides tons of random interesting facts about science, literature, philosophy and other cool topics.

Checking API status...

/v1/facts GET

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.


Parameters

  • limit  optional premium only

    How many results to return. Must be between 1 and 100. Default is 1.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Sample Request Live Demo!

https://api.api-ninjas.com/v1/facts

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
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" } ]

Code Examples

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.