This API provides a simple way to access interesting and random facts.
To start using the ducks-facts API, you'll first need to register to obtain an API key. This key will be used to authenticate your requests and track your usage.
base url: https://duck-api.netlify.app
To register for an API key, fill out the form on our website. You’ll receive your key by email.
{
"message": "Registration successful!",
"apiKey": "YOUR_NEWLY_GENERATED_API_KEY",
"initialCredits": 500
}All authenticated endpoints require your API key to be sent in the X-api-key header of your HTTP requests.
Example Header:
X-api-key: YOUR_API_KEY_HERE
GET /api/facts/random
This endpoint returns a random, interesting fact. You must provide your API key in the request headers.
X-api-key: Your API key.
{
"id": 54,
"fact": "Most duck species are monogamous for a breeding season but typically find new mates each year."
}GET /api/usage
This endpoint allows you to check your remaining API credits. You must provide your API key in the request headers.
X-api-key: Your API key.
{
"message": "API usage details",
"remainingCredits": 481
}GET /api/image/random
This endpoint allows you to get a random image. You must provide your API key in the request headers.
X-api-key: Your API key.
{
"id": 32,
"url": "https://ik.imagekit.io/duckapi/32.jpg"
}-
Add some high-quality duck images -
Expand API endpoints for image delivery - The chance to add custom duck facts into the API
- Community image upload
- Posibility to search image and fact by id

