Today in History

learn more on Wikipedia

Events

    Births

      Deaths

        What is this?

        I wanted to write a 'this day in history' twitter bot, which posts events which happened on this 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 https://history.muffinlabs.com/date
        
        {
          "date":"June 27",
          "url":"http://wikipedia.org/wiki/June_27",
          "data":{
            "Events":[
              {
                "year": "1759",
                "html": "<a href=\"http://wikipedia.com/wiki/1759\" title=\"1759\">1759</a> – General <a href=\"http://wikipedia.com/wiki/James_Wolfe\" title=\"James Wolfe\">James Wolfe</a> begins the siege of <a href=\"http://wikipedia.com/wiki/Quebec\" title=\"Quebec\">Quebec</a>.",
                "text": "General James Wolfe begins the siege of Quebec.",
                "links": [
                  {
                    "title": "James Wolfe",
                    "link": "http://wikipedia.com/wiki/James_Wolfe"
                  },
                  {
                    "title": "Quebec",
                    "link": "http://wikipedia.com/wiki/Quebec"
                  }
                ]
              },
              ...
              // lots of other data
              ...
            ],
            "Births":[
              {
                "year": "2009",
                "html": "<a href=\"http://wikipedia.com/wiki/2009\" title=\"2009\">2009</a> – <a href=\"http://wikipedia.com/wiki/Fayette_Pinkney\" title=\"Fayette Pinkney\">Fayette Pinkney</a>, American sin
        ger (<a href=\"http://wikipedia.com/wiki/The_Three_Degrees\" title=\"The Three Degrees\">The Three Degrees</a>) (b. 1948)",
                "text": "Fayette Pinkney, American singer (The Three Degrees) (b. 1948)",
                "links": [
                  {
                    "title": "Fayette Pinkney",
                    "link": "http://wikipedia.com/wiki/Fayette_Pinkney"
                  },
                  {
                    "title": "The Three Degrees",
                    "link": "http://wikipedia.com/wiki/The_Three_Degrees"
                  }
                ]
              }
              ...
              // lots of other data
              ...
            ],
            "Deaths":[
              {
                "year": "2013",
                "text": "Peter Waieng, Papua New Guinea politician (b. 1966)",
                "links": [
                  {
                    "title": "Peter Waieng",
                    "link": "/wiki/Peter_Waieng"
                  }
                ]
              }
              ...
              // lots of other data
              ...
            ]
          }
        }
                

        Get another day's history in JSON at /date/month/day where month and day are numbers. For example, /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",
                "html": "<a href=\"http://wikipedia.com/wiki/42_BC\" title=\"42 BC\">42 BC</a> – The <a href=\"http://wikipedia.com/wiki/Roman_Senate\" title=\"Roman Senate\">Roman Senate</a> posthumously <a href=\"http://wikipedia.com/wiki/Apotheosis\" title=\"Apotheosis\">deifies</a> <a href=\"http://wikipedia.com/wiki/Julius_Caesar\" title=\"Julius Caesar\">Julius Caesar</a>",
                "text": "The Roman Senate posthumously deifies Julius Caesar",
                "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.

        Twitter

        And here's @happened_today on Twitter:

        Getting the Data

        If you would like your own copy of the data, you can generate it using the history_parse code here. This is a bit of a work in progress, but it's certainly functional.

        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.