{
 "openapi": "3.1.0",
 "info": {
  "title": "jesseahawkins.com data API",
  "version": "1",
  "description": "Static JSON files, one for each dataset and each fixed release. No key, no sign-in, no rate limit beyond the host’s. Within v1 a dataset id, a field name and a field type never change. Each dataset carries its own terms in `terms`; follow them."
 },
 "servers": [
  {
   "url": "https://jesseahawkins.com/data/v1"
  }
 ],
 "externalDocs": {
  "url": "https://jesseahawkins.com/data/api/"
 },
 "paths": {
  "/index.json": {
   "get": {
    "operationId": "index",
    "summary": "Every dataset, with its fields and links",
    "responses": {
     "200": {
      "description": "The index",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/datasets/{id}.json": {
   "get": {
    "operationId": "dataset",
    "summary": "The current rows of one dataset",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The dataset id, as /data/v1/index.json lists it.",
      "schema": {
       "enum": [
        "buildout.promises",
        "buildout.sites",
        "buildout.spending",
        "power.bill",
        "power.capacity",
        "power.grids",
        "power.nuclear",
        "power.plants",
        "power.queue",
        "power.states",
        "power.tariffs",
        "power.utilities",
        "power.world",
        "machine.chip-plants",
        "machine.chips",
        "machine.imports",
        "machine.sales",
        "machine.supercomputers",
        "chips.accelerators",
        "chips.books",
        "chips.controls",
        "chips.cost",
        "chips.cycle",
        "chips.fab-spending",
        "chips.fabs",
        "chips.inference-gains",
        "chips.inference",
        "chips.market",
        "chips.materials",
        "chips.memory-prices",
        "chips.memory",
        "chips.nodes",
        "jobs.occupations",
        "ledger.ledger",
        "frontier.catch-up",
        "frontier.clock",
        "frontier.downloads-labs",
        "frontier.downloads",
        "frontier.reigns",
        "frontier.retirements",
        "vendors",
        "vendors.federal-by",
        "vendors.federal",
        "vendors.questionnaire",
        "vendors.status-incidents",
        "rules.enforcement.enforcement",
        "rules.rules",
        "asia.asia",
        "dispatch.scores",
        "records",
        "records.capex",
        "records.chip-output",
        "records.chip-utilization",
        "records.grads",
        "records.hires",
        "records.home-power",
        "records.imports-servers",
        "records.imports",
        "records.layoffs",
        "records.log",
        "records.openings",
        "records.payrolls",
        "records.postings",
        "records.ppi-boards",
        "records.ppi-chips",
        "records.ppi-servers",
        "records.ppi-storage",
        "records.spending",
        "records.states-log",
        "records.states",
        "records.unemployment",
        "series",
        "companies",
        "explorer.campuses",
        "explorer.countries",
        "explorer.supercomputers"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The dataset",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "api",
          "id",
          "fields",
          "freshness",
          "rows"
         ],
         "properties": {
          "api": {
           "const": "v1"
          },
          "id": {
           "type": "string"
          },
          "fields": {
           "type": "array",
           "items": {
            "type": "object",
            "required": [
             "name",
             "type",
             "tier"
            ],
            "properties": {
             "name": {
              "type": "string"
             },
             "type": {
              "enum": [
               "string",
               "number"
              ]
             },
             "tier": {
              "enum": [
               "quoted",
               "derived",
               "modelled",
               null
              ]
             },
             "tierBy": {
              "type": "object",
              "required": [
               "field",
               "values"
              ],
              "properties": {
               "field": {
                "type": "string"
               },
               "values": {
                "type": "object",
                "additionalProperties": {
                 "enum": [
                  "quoted",
                  "derived",
                  "modelled"
                 ]
                }
               }
              }
             }
            }
           }
          },
          "tiers": {
           "type": "array",
           "items": {
            "enum": [
             "quoted",
             "derived",
             "modelled"
            ]
           }
          },
          "provenance": {
           "type": [
            "string",
            "null"
           ]
          },
          "freshness": {
           "type": "object",
           "required": [
            "state",
            "asOf",
            "oldestCheck",
            "next",
            "late",
            "status",
            "sources",
            "notice"
           ],
           "properties": {
            "state": {
             "enum": [
              "current",
              "due",
              "late",
              "on-demand"
             ]
            },
            "asOf": {
             "type": "string"
            },
            "oldestCheck": {
             "type": "string"
            },
            "next": {
             "type": [
              "string",
              "null"
             ]
            },
            "late": {
             "type": [
              "string",
              "null"
             ]
            },
            "status": {
             "type": "string"
            },
            "sources": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "notice": {
             "type": [
              "string",
              "null"
             ]
            }
           }
          },
          "rows": {
           "type": "array",
           "items": {
            "type": "object",
            "additionalProperties": {
             "oneOf": [
              {
               "type": "string"
              },
              {
               "type": "number"
              },
              {
               "type": "null"
              }
             ]
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/datasets/{id}/releases.json": {
   "get": {
    "operationId": "releases",
    "summary": "Every fixed release of one dataset",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The dataset id, live or retired.",
      "schema": {
       "enum": [
        "buildout.promises",
        "buildout.sites",
        "buildout.spending",
        "power.bill",
        "power.capacity",
        "power.grids",
        "power.nuclear",
        "power.plants",
        "power.queue",
        "power.states",
        "power.tariffs",
        "power.utilities",
        "power.world",
        "machine.chip-plants",
        "machine.chips",
        "machine.imports",
        "machine.sales",
        "machine.supercomputers",
        "chips.accelerators",
        "chips.books",
        "chips.controls",
        "chips.cost",
        "chips.cycle",
        "chips.fab-spending",
        "chips.fabs",
        "chips.inference-gains",
        "chips.inference",
        "chips.market",
        "chips.materials",
        "chips.memory-prices",
        "chips.memory",
        "chips.nodes",
        "jobs.occupations",
        "ledger.ledger",
        "frontier.catch-up",
        "frontier.clock",
        "frontier.downloads-labs",
        "frontier.downloads",
        "frontier.reigns",
        "frontier.retirements",
        "vendors",
        "vendors.federal-by",
        "vendors.federal",
        "vendors.questionnaire",
        "vendors.status-incidents",
        "rules.enforcement.enforcement",
        "rules.rules",
        "asia.asia",
        "dispatch.scores",
        "records",
        "records.capex",
        "records.chip-output",
        "records.chip-utilization",
        "records.grads",
        "records.hires",
        "records.home-power",
        "records.imports-servers",
        "records.imports",
        "records.layoffs",
        "records.log",
        "records.openings",
        "records.payrolls",
        "records.postings",
        "records.ppi-boards",
        "records.ppi-chips",
        "records.ppi-servers",
        "records.ppi-storage",
        "records.spending",
        "records.states-log",
        "records.states",
        "records.unemployment",
        "series",
        "companies",
        "explorer.campuses",
        "explorer.countries",
        "explorer.supercomputers"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The releases",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/datasets/{id}/releases/{release}.json": {
   "get": {
    "operationId": "release",
    "summary": "One fixed release as JSON; it never changes",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The dataset id, live or retired.",
      "schema": {
       "enum": [
        "buildout.promises",
        "buildout.sites",
        "buildout.spending",
        "power.bill",
        "power.capacity",
        "power.grids",
        "power.nuclear",
        "power.plants",
        "power.queue",
        "power.states",
        "power.tariffs",
        "power.utilities",
        "power.world",
        "machine.chip-plants",
        "machine.chips",
        "machine.imports",
        "machine.sales",
        "machine.supercomputers",
        "chips.accelerators",
        "chips.books",
        "chips.controls",
        "chips.cost",
        "chips.cycle",
        "chips.fab-spending",
        "chips.fabs",
        "chips.inference-gains",
        "chips.inference",
        "chips.market",
        "chips.materials",
        "chips.memory-prices",
        "chips.memory",
        "chips.nodes",
        "jobs.occupations",
        "ledger.ledger",
        "frontier.catch-up",
        "frontier.clock",
        "frontier.downloads-labs",
        "frontier.downloads",
        "frontier.reigns",
        "frontier.retirements",
        "vendors",
        "vendors.federal-by",
        "vendors.federal",
        "vendors.questionnaire",
        "vendors.status-incidents",
        "rules.enforcement.enforcement",
        "rules.rules",
        "asia.asia",
        "dispatch.scores",
        "records",
        "records.capex",
        "records.chip-output",
        "records.chip-utilization",
        "records.grads",
        "records.hires",
        "records.home-power",
        "records.imports-servers",
        "records.imports",
        "records.layoffs",
        "records.log",
        "records.openings",
        "records.payrolls",
        "records.postings",
        "records.ppi-boards",
        "records.ppi-chips",
        "records.ppi-servers",
        "records.ppi-storage",
        "records.spending",
        "records.states-log",
        "records.states",
        "records.unemployment",
        "series",
        "companies",
        "explorer.campuses",
        "explorer.countries",
        "explorer.supercomputers"
       ]
      }
     },
     {
      "name": "release",
      "in": "path",
      "required": true,
      "description": "A release id from releases.json.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The release",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "api",
          "id",
          "release",
          "fields",
          "rows"
         ],
         "properties": {
          "fields": {
           "type": "array",
           "items": {
            "type": "object",
            "required": [
             "name",
             "type"
            ],
            "properties": {
             "name": {
              "type": "string"
             },
             "type": {
              "enum": [
               "string",
               "number"
              ]
             }
            }
           }
          },
          "rows": {
           "type": "array",
           "items": {
            "type": "object",
            "additionalProperties": {
             "oneOf": [
              {
               "type": "string"
              },
              {
               "type": "number"
              },
              {
               "type": "null"
              }
             ]
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
}
