Save over 30% when you subscribe to an annual subscription plan!

Day in History API

The Day in History API provides historical events that happened on a specific date. Free users receive events for today's date only - premium users can specify custom dates and control pagination.

Checking API status...

/v1/dayinhistory GET

https://api.api-ninjas.com/v1/dayinhistory

Returns historical events that occurred on a specific date. If no date parameters are provided, returns events for today's date. Date parameters are premium-only features.


Parameters

  • month  optional premium only

    The month of the historical events to retrieve. Must be between 1 and 12. If specified, day must also be provided. If both are omitted, today's date is used.

  • day  optional premium only

    The day of the month for the historical events to retrieve. Must be between 1 and 31. If specified, month must also be provided. If both are omitted, today's date is used.

  • offset  optional premium only

    The number of results to skip. Must be zero or a positive integer. Default is 0.

  • limit  optional premium only

    The maximum number of results to return. Must be between 1 and 30. Default is 1.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

Returns a JSON array of objects, each with the following properties:

  • year

    The year of the historical event.

  • month

    The month of the historical event (1-12).

  • day

    The day of the month of the historical event.

  • event

    A description of the historical event.

Sample Request Live Demo!

https://api.api-ninjas.com/v1/dayinhistory

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
1 2 3 4 5 6 7 8 [ { "year": 1969, "month": 7, "day": 20, "event": "Apollo program: Apollo 11's crew successfully makes the first human landing on the Moon in the Sea of Tranquility. Americans Neil Armstrong and Buzz Aldrin become the first humans to walk on the Moon six and a half hours later." } ]

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/dayinhistory" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.