Welcome to the Fun Random Facts API. This service provides a treasure trove of interesting, quirky, and educational facts for your applications. No authentication required!
All API requests should be made to:
https://cnichols1734.pythonanywhere.com
/facts/random
Returns a random fun fact. Prepare to be amazed!
GET https://cnichols1734.pythonanywhere.com/facts/random
{
"id": 42,
"fact": "The shortest war in history lasted 38 minutes.",
"category": "History",
"source": "Historical Records",
"date_added": "2024-09-21 03:35:10",
"language": "en",
"tags": "war, history, shortest",
"author": "admin"
}
/categories
Retrieves a list of all available categories.
GET https://cnichols1734.pythonanywhere.com/categories
{
"categories": ["Science", "History", "Technology", "Art"]
}
/facts/random/<category>
Returns a random fun fact from a specified category.
GET https://cnichols1734.pythonanywhere.com/facts/random/Science
{
"id": 85,
"fact": "Honey never spoils. Archaeologists have found pots of honey in ancient Egyptian tombs that are over 3,000 years old and still edible.",
"category": "Science",
"source": "National Geographic",
"date_added": "2024-09-21 10:15:30",
"language": "en",
"tags": "honey, preservation, food",
"author": "admin"
}
The API returns a JSON object with the following structure:
To ensure fair usage and prevent our servers from exploding, the API is limited to 120 requests per minute per IP address. Exceeding this limit will result in a 429 Too Many Requests response.
The API uses conventional HTTP response codes to indicate success or failure of requests:
This API is provided for educational and entertainment purposes only. While we strive for accuracy, we cannot guarantee the absolute truth of every fact. Use the information at your own discretion.