{
  "openapi": "3.1.0",
  "info": {
    "title": "Day In History API",
    "version": "1.0.0",
    "description": "Events, births, deaths and holidays for any day of the year from Wikipedia's On This Day, with thumbnails.\n\nHistorical events, notable births and deaths, holidays and Wikipedia's editor-selected highlights for any day of the year, live from Wikipedia's \"On this day\" feed (CC BY-SA 4.0) with 24-hour caching. Every item carries the year, the event text, the linked article's title, short description, Wikipedia URL and thumbnail; pick a type, newest-first or oldest-first ordering, and a limit, and see totals per type. Accepts MM-DD or full dates and rejects impossible days.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/day-in-history.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/day-in-history"
  },
  "servers": [
    {
      "url": "https://api-day-in-history.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Entertainment",
      "description": "Day In History API belongs to the Entertainment category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/sources": {
      "get": {
        "operationId": "dataSources",
        "summary": "Data Sources",
        "description": "Data Sources endpoint of the Day In History API. Costs 5 tokens per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/day-in-history/data-sources"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "sources": [
                    {
                      "slug": "wikipedia-onthisday",
                      "name": "Wikipedia — On this day",
                      "url": "https://api.wikimedia.org/feed/v1/wikipedia/en/onthisday",
                      "license": "CC BY-SA 4.0",
                      "license_url": "https://creativecommons.org/licenses/by-sa/4.0/",
                      "cadence": "live, edge-cached 24h per date"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/onthisday": {
      "get": {
        "operationId": "onThisDay",
        "summary": "On This Day",
        "description": "On This Day endpoint of the Day In History API. Costs 5 tokens per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/day-in-history/on-this-day"
        },
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "07-20"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "20"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "desc"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "events"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "date": "07-20",
                  "order": "desc",
                  "source": "Wikipedia — On this day",
                  "license": "CC BY-SA 4.0",
                  "license_url": "https://creativecommons.org/licenses/by-sa/4.0/",
                  "totals": {
                    "events": 69
                  },
                  "events": [
                    {
                      "year": 1969,
                      "text": "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.",
                      "title": "Apollo program",
                      "description": "1961–1972 American crewed lunar exploration program",
                      "wikipedia_url": "https://en.wikipedia.org/wiki/Apollo_program",
                      "thumbnail": "https://thumb.wikimedia.org/wikipedia/commons/thumb/0/00/Apollo_program.svg/330px-Apollo_program.svg.png?utm_source=en.wikipedia.org&utm_campaign=api&utm_content=thumbnail"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 5 tokens per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}