Today in History
Events
Births
Deaths
What is this?
I've worked on a few projects where I wanted to have some basic historical information for any given day. There's a bunch of databases of historical events out there, but most of them are closed, commerical, or they suck.
Luckily, Wikipedia has entries for each day of the year. I wrote a parser to turn this into JSON data, and a very simple app to spit out that data for any given day.
Just for kicks, I wrote a pretty simple JS interface as well. It's generating the tickers at the top of this page
API
Here's a simple API you can use to find out what happened today:
Get today's history in JSON format at /date
curl http://history.muffinlabs.com/date
Get another day's history in JSON at /date/month/day where month and day are numbers. For example, visit /date/2/14 to get the history for February 14th.
curl http://history.muffinlabs.com/date/2/14
{
"date": "February 14",
"url": "http://wikipedia.org/wiki/February_14",
"data":{
"Events":[ // data here // ],
"Births":[ // data here // ],
"Deaths":[ // data here // ]
}
}
The data is split into births, deaths, and events. Each element is a hash that looks a little like this:
{
"year": "42 BC",
"text": "The Roman Senate posthumously deifies Julius Caesar",
"html": "// some html that describes the event, with links to wikipedia //",
"no_year_html": "// html but not prepended with the year //",
"links": [
{
"title": "Roman Senate",
"link": "http://wikipedia.com/wiki/Roman_Senate"
},
{
"title": "Apotheosis",
"link": "http://wikipedia.com/wiki/Apotheosis"
},
{
"title": "Julius Caesar",
"link": "http://wikipedia.com/wiki/Julius_Caesar"
}
]
}
Depending on your needs, you can either use the pre-rendered HTML, or some sort of combination of the text and subject links.
There's also a very simple Javascript API which you can use to put history data on a website.
Getting the Data
If you would like your own copy of the data, you can generate it using the code here.
License
This website and data are licensed using CC BY-SA 3.0, the same license used for Wikipedia data. You are free to share and adapt the data, but it must be attributed and any alterations must be shared under a compatible license.