General Fun Facts
This Fun Fact API provides a random, interesting fact from our curated database covering history, science, nature, and technology. It requires no input configurations.
Endpoint
Section titled “Endpoint” POST
/api/v1/funfact Request Parameters
Section titled “Request Parameters”This endpoint does not require any JSON body parameters.
| Field | Type | Required | Description |
|---|---|---|---|
| (None) | - | - | Send an empty JSON object {}. |
Request Examples
Section titled “Request Examples”curl -X POST https://heavstal.com.ng/api/v1/funfact \-H "Content-Type: application/json" \-H "x-api-key: <YOUR_API_KEY>" \-d '{}'const response = await fetch('https://heavstal.com.ng/api/v1/funfact', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': '<YOUR_API_KEY>' }, body: JSON.stringify({})});
const res = await response.json();console.log(res.data.fact);import { tools } from '@heavstal/api';
const fact = await tools.funfact();console.log(fact.data.fact);import requests
url = "https://heavstal.com.ng/api/v1/funfact"headers = { "Content-Type": "application/json", "x-api-key": "<YOUR_API_KEY>"}
response = requests.post(url, headers=headers, json={})print(response.json()["data"]["fact"])Response Examples
Section titled “Response Examples”{ "status": "success", "creator": "HEAVSTAL TECH", "data": { "id": 14, "category": "animals", "fact": "Wombat poop is cube-shaped to stop it from rolling away." }}