Free Random Facts API
A free, open JSON API that serves random facts. No API key, no sign-up, just fetch and go. Perfect for apps, bots, dashboards, and weekend projects.
Base URL
All requests use HTTPS. The API returns JSON with Content-Type: application/json. CORS is fully enabled so you can call it from any domain.
Endpoints
There is one endpoint with optional query parameters.
Returns one or more random facts, optionally filtered by category.
| Parameter | Type | Description |
|---|---|---|
| cat | string | Filter by category slug (e.g. science, space). Optional. |
| count | integer | Number of facts to return (1–10). Default: 1 |
Single Fact Response
Multiple Facts Response ?count=3
Error Response
Try It Live
Hit the API right from this page. Edit the URL and press Send.
Code Examples
Copy-paste snippets to start using the API in seconds.
Rate Limits
60 requests per minute per IP address. If you exceed this limit, the API will return a 429 Too Many Requests response with a Retry-After header.
This is generous enough for most use cases. If you need higher limits, reach out and we'll work something out.
Attribution (Required)
The FactFacts API is completely free. All we ask is that you credit FactFacts.com with a visible link wherever you display the facts. Every API response includes an attribution object to make this easy.
Example attribution in your app or site:
Facts from FactFacts.com
Facts from <a href="https://factfacts.com">FactFacts.com</a>
Facts from [FactFacts.com](https://factfacts.com)
The link should be visible to users (not hidden or no-follow). Footer placement is fine. If you're using the data in a mobile app, a link in your About or Credits screen works.
HTTP Status Codes
| Code | Meaning | When |
|---|---|---|
| 200 | OK | Successful request |
| 405 | Method Not Allowed | Non-GET request |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Server Error | Facts database issue |
Frequently Asked Questions
general. If you pass an invalid category, the API will return a list of all available categories in the error response. Try ?cat=science, ?cat=space, etc.Access-Control-Allow-Origin: * so you can call it from any domain, including client-side JavaScript in the browser.count parameter is capped at 10 per request. If you need more, make multiple requests. With the 60/min rate limit you can fetch up to 600 facts per minute.GET requests are accepted."ok": false and an "error" field explaining what went wrong. For category errors, you'll also get an available_categories array.