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
monthoptional premium onlyThe month of the historical events to retrieve. Must be between
1and12. If specified,daymust also be provided. If both are omitted, today's date is used.dayoptional premium onlyThe day of the month for the historical events to retrieve. Must be between
1and31. If specified,monthmust also be provided. If both are omitted, today's date is used.offsetoptional premium onlyThe number of results to skip. Must be zero or a positive integer. Default is
0.limitoptional premium onlyThe maximum number of results to return. Must be between
1and30. Default is1.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
Returns a JSON array of objects, each with the following properties:
yearThe year of the historical event.
monthThe month of the historical event (1-12).
dayThe day of the month of the historical event.
eventA description of the historical event.
Sample Request Live Demo!
https://api.api-ninjas.com/v1/dayinhistoryHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
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.