Skip to content

Latest commit

 

History

History
60 lines (47 loc) · 1.57 KB

README.md

File metadata and controls

60 lines (47 loc) · 1.57 KB

in the year

Get information about events, births, and deaths in any year according to Wikipedia.

Usage

GET

https://in-the-year.vercel.app/api/{year}/

Response

// Success, status code 200
{
   events: string[]
   births: string[]
   deaths: string[]
}

Notes

  • Valid years are 4000 BC - 2030 AD with the obivious abscence of 0.
  • Years BC are encoded as negative such that the year 44 BC equals -44.
  • Not all years will work and will return error 404. This is likely due to a lack of content for that year.

Example

// Request
fetch("https://in-the-year.vercel.app/api/-44/")

// Response
{
  "events": [
    "Consuls: Gaius Julius Caesar and Mark Antony.",
    "February – Rome celebrates the festival of the Lupercal. Mark Antony twice presents Caesar with a royal diadem, urging him to take it and declare himself king. He refuses this offer and orders the crown to be placed in the Temple of Jupiter.",
    "March 15 (the Ides of March) – Julius Caesar, dictator of Rome, is assassinated by a group of senators, amongst them Gaius Cassius Longinus, Marcus Junius Brutus, and Caesar's Massilian naval commander, Decimus Brutus.",
    ...
  ],
  "births": [
   "Gnaeus Calpurnius Piso, Roman statesman and governor (d. 20 AD)"
  ],
  "deaths": [
    "March 15 – Julius Caesar, Roman politician and general (assassinated in the Senate) (b. 100 BC)",
    "July 26 – Ptolemy XIV, king (pharaoh) of Egypt (approximate date)",
    ...
  ]
}

License

MIT @ Charlie Morris