NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

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.

(4.3)

From 6,043 users

700+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
321ms365ms388ms543ms1015ms

Didn't find what you were looking for? Suggest an improvement


/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.

Parameters

  • month  optional premium

    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

    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

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

  • limit  optional premium

    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

A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.

  • 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!

month premium
day premium
offset premium
limit premium

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/dayinhistory?month=7&day=20

Headers

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

Sample Response

JSON
[
    {
      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.

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the Day in History API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • Pass both the month (1-12) and day (1-31) query parameters to retrieve events for that calendar date; if you omit them, the endpoint returns events for today's date. Custom dates are a premium feature, while free users always receive today's events.
  • Each call returns a JSON array of event objects with a year, month, day, and an event field describing what happened. See the error codes page for what is returned when a request is unsuccessful.
  • Use the limit parameter (between 1 and 30, default 1) to control how many events return, and the offset parameter to skip results for pagination. Both are premium parameters.
  • It is great for building 'on this day' widgets, daily history newsletters, trivia games, or educational apps that surface events tied to the current date. For related content you can pair it with the Historical Events API, Historical Figures API, or Trivia API.