Historical Events API
The Historical Events API allows you to search for famous events in history. From ancient antiquity to modern times, events from all parts of human civilization are recorded.
From 10,001 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 393ms | 412ms | 463ms | 702ms | 1115ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
/v1/historicalevents GET
https://api.api-ninjas.com/v1/historicalevents
Returns a list of up to 10 events that match the search parameters. Use the offset parameter to paginate through more results.
Parameters
textoptionalQuery text to search events by. Use keywords or short phrases for best match results.
yearoptional4-digit year (e.g.
1776). For BC/BCE years, use a negative integer (e.g.-351for 351 BC).monthoptionalInteger month (e.g.
3for March).dayoptionalCalendar day of the month.
offsetoptional premium onlyNumber of results to offset pagination.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.
yearThe year of the event. For BC/BCE years, this is a negative integer (e.g.,
"-45"for 45 BC).monthThe month of the event as a 2-digit string (e.g.,
"01"for January).dayThe day of the month as a 2-digit string.
eventDescription of the historical event.
Sample Request Live Demo!
https://api.api-ninjas.com/v1/historicalevents?text=roman%20empireHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/historicalevents?month=1&day=1" \
-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
Can I use the Historical Events API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the Historical Events API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.How do I get an API key and start using the Historical Events API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
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.What happens if a request to the Historical Events API fails?
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.How do I search for historical events by topic or by a specific date?
Pass keywords or a short phrase to thetextparameter (e.g. 'roman empire') to search by topic, or use theyear,month, anddayparameters to filter by date; for BC/BCE years use a negative integer such as-351for 351 BC. You can also explore date-based events with the related Day in History API.What fields are included in the response?
Each request returns a JSON array of up to 10 event objects, each with ayear,month(a 2-digit string like '01'),day(a 2-digit string), and aneventdescription. See the error codes page for what is returned when a request is unsuccessful.How do I get more than 10 results for a query?
Each call returns up to 10 matching events, so use theoffsetparameter to paginate through additional results; note thatoffsetis a premium-only feature available on paid plans.What are some use cases for the Historical Events API?
It is great for building 'on this day' widgets, trivia and quiz games, educational timelines, and history-themed content that draws on famous events from ancient antiquity to modern times. Pair it with the Historical Figures API or browse all of our APIs for more options.