January Sale! Get over 30% off when you subscribe to an annual plan!

Facts API

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

Available endpoints:

(4.1)

From 5,234 users

3,400+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
341ms384ms432ms812ms1218ms

Didn't find what you were looking for? Suggest an improvement


/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 500,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!

limit premium

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/facts?limit=1

Headers

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

Sample Response

JSON

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.


/v1/factoftheday GET

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

Returns a single fact for the current day. The same fact is returned for all requests on the same day, and changes each day. Perfect for displaying on your website or app. No parameters are available for this endpoint to ensure everyone sees the same fact of the day.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

Same response format as /v1/facts (always returns a single fact).

Sample Request Live Demo!

Try this API endpoint with all available parameters in our API playground

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

Headers

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

Sample Response

JSON

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/factoftheday" \ -H "X-Api-Key: YOUR_API_KEY"