Random Facts
Get random interesting facts from a curated database covering science, history, technology, nature, space, and food.
Overview
Use Cases
- Daily fact widgets and educational sidebars
- Trivia games and quiz apps
- Loading screen content and onboarding copy
- Educational platforms and learning apps
Features
Curated facts across 6 categories
Optional category filtering
Includes source attribution for each fact
API Endpoints
Get Random Fact
Returns a randomly selected fact, optionally filtered by category.
GET
https://api.requiems.xyz/v1/entertainment/facts
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| category | string |
Optional | Filter by category. Valid values: science, history, technology, nature, space, food |
Try it out
Live DemoRequest
Filter by category. Valid values: science, history, technology, nature, space, food
Sending request...
Response Fields
| Field | Type | Description |
|---|---|---|
| fact | string |
The fact text |
| category | string |
The category the fact belongs to |
| source | string |
The source or publication the fact is attributed to |
Code Examples
# Random fact from any category
curl https://api.requiems.xyz/v1/entertainment/facts \
-H "requiems-api-key: YOUR_API_KEY"
# Random science fact
curl "https://api.requiems.xyz/v1/entertainment/facts?category=science" \
-H "requiems-api-key: YOUR_API_KEY"
import requests
url = "https://api.requiems.xyz/v1/entertainment/facts"
headers = {"requiems-api-key": "YOUR_API_KEY"}
# Optional: filter by category
params = {"category": "space"}
response = requests.get(url, headers=headers, params=params)
data = response.json()['data']
print(f"[{data['category']}] {data['fact']} β {data['source']}")
const response = await fetch(
'https://api.requiems.xyz/v1/entertainment/facts?category=history',
{ headers: { 'requiems-api-key': 'YOUR_API_KEY' } }
);
const { data } = await response.json();
console.log(`[${data.category}] ${data.fact} β ${data.source}`);
require 'net/http'
require 'json'
uri = URI('https://api.requiems.xyz/v1/entertainment/facts')
uri.query = URI.encode_www_form(category: 'nature')
request = Net::HTTP::Get.new(uri)
request['requiems-api-key'] = 'YOUR_API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
data = JSON.parse(response.body)['data']
puts "[#{data['category']}] #{data['fact']} β #{data['source']}"
Error Responses
400
bad_request
Frequently Asked Questions
There are six categories: science, history, technology, nature, space, and food.
The API returns a 400 Bad Request error with a descriptive message.
Yes. Every fact in the database includes source attribution from a reputable publication or institution.