{
 "openapi": "3.1.0",
 "info": {
  "title": "slashyear",
  "version": "1.0.0",
  "description": "Sourced history as static JSON. No key, no rate limit, CORS open.",
  "license": {
   "name": "CC BY-SA 4.0",
   "url": "https://creativecommons.org/licenses/by-sa/4.0/"
  }
 },
 "servers": [
  {
   "url": "https://slashyear.com"
  }
 ],
 "paths": {
  "/api/years.json": {
   "get": {
    "summary": "index of every published year",
    "parameters": [],
    "responses": {
     "200": {
      "description": "index of every published year",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/year/{year}.json": {
   "get": {
    "summary": "one year; astronomical numbering, so -43 is 44 BCE",
    "parameters": [
     {
      "name": "year",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "one year; astronomical numbering, so -43 is 44 BCE",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/dates.json": {
   "get": {
    "summary": "index of all 366 calendar dates",
    "parameters": [],
    "responses": {
     "200": {
      "description": "index of all 366 calendar dates",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/date/{month-day}.json": {
   "get": {
    "summary": "one calendar day across every year",
    "parameters": [
     {
      "name": "month-day",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "one calendar day across every year",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/cross.json": {
   "get": {
    "summary": "index of every century, decade and subject",
    "parameters": [],
    "responses": {
     "200": {
      "description": "index of every century, decade and subject",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/century/{slug}.json": {
   "get": {
    "summary": "one century: its decades, subjects and highlights",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "one century: its decades, subjects and highlights",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/decade/{slug}.json": {
   "get": {
    "summary": "one decade: its years and their leading entries",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "one decade: its years and their leading entries",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/topic/{slug}.json": {
   "get": {
    "summary": "one subject across every century",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "one subject across every century",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/topic/{slug}/{century}.json": {
   "get": {
    "summary": "one subject inside one century",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "century",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "one subject inside one century",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/entities.json": {
   "get": {
    "summary": "index of every subject that has a timeline",
    "parameters": [],
    "responses": {
     "200": {
      "description": "index of every subject that has a timeline",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/entity/{slug}.json": {
   "get": {
    "summary": "one subject: every dated entry naming it, in order, with its Wikidata id",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "one subject: every dated entry naming it, in order, with its Wikidata id",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/search": {
   "get": {
    "summary": "subjects matching a query and their dated entries; &from= &to= &limit=",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "free text; matched against subject names and descriptions"
     },
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "integer"
      },
      "description": "earliest year, astronomical numbering"
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 20
      }
     }
    ],
    "responses": {
     "200": {
      "description": "subjects matching a query and their dated entries; &from= &to= &limit=",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/dump/events.ndjson.gz": {
   "get": {
    "summary": "every dated entry on the site, gzipped newline-delimited JSON",
    "parameters": [],
    "responses": {
     "200": {
      "description": "every dated entry on the site, gzipped newline-delimited JSON",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/dump/years.ndjson.gz": {
   "get": {
    "summary": "one record per year",
    "parameters": [],
    "responses": {
     "200": {
      "description": "one record per year",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/dump/entities.ndjson.gz": {
   "get": {
    "summary": "one record per subject timeline",
    "parameters": [],
    "responses": {
     "200": {
      "description": "one record per subject timeline",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/dump/datapackage.json": {
   "get": {
    "summary": "Frictionless description of the three dumps",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Frictionless description of the three dumps",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  }
 }
}