Duck as a service (DaaS) API

If you want to get your duck fact of the day, this is your website.

This website is dedicated to spreading knowledge and appreciation for ducks. Facts from their migratory patterns to their social behaviors, there's always something new to learn about ducks! If you have any interesting duck facts you'd like to share, feel free to reach out to me. Quack on!


If you want an API key for your website/app:


Duck painting in aquarella

How to use the API

Fetch a Random Fact

This endpoint returns a random, interesting fact. You must provide your API key in the request headers.

GET /api/facts/random

and the API response would look like this:

{
  "id": 54,
  "fact": "Most duck species are monogamous for a breeding season but typically find new mates each year."
}

Fetch API usage details

This endpoint allows you to check your remaining API credits. You must provide your API key in the request headers.

GET /api/usage

and the API response would look like this:

{
  "message": "API usage details",
  "remainingCredits": 332
}

Fetch a random image of ducks

This endpoint allows you to receive a random high quality image of ducks. You must provide your API key in the request headers.

GET /api/random/image

and the API response would look like this:

{
  "id": 32
  "url": "https://ik.imagekit.io/duckapi/32.jpg"
}

What's next?