{
  "openapi": "3.1.0",
  "info": {
    "title": "CCA Community API",
    "version": "0.1.0",
    "description": "Census geography resolution + tract-level social determinants of survival (SDOS) data. Resolves an address / ZIP / lat-lon to its full Census geography hierarchy (via TIGERweb) and serves a cached bundle of ACS, CDC PLACES, CDC SVI, EPA EJScreen, FEMA NRI, and USDA Food Access indicators keyed by 11-digit tract GEOID. Part of the CCA data-service fleet."
  },
  "servers": [
    {
      "url": "https://community.datasourceapi.com"
    }
  ],
  "paths": {
    "/api/v1/status": {
      "get": {
        "summary": "Service health + binding/source catalog",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/geographies": {
      "get": {
        "summary": "Resolve a location to its Census geography hierarchy",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "One-line street address"
          },
          {
            "name": "zip",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "5-digit ZIP / ZCTA"
          },
          {
            "name": "lat",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "lon",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "include",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "data"
              ]
            },
            "description": "Set 'data' to also bundle the tract SDOS data"
          },
          {
            "name": "acs_year",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "ACS vintage when include=data"
          }
        ],
        "responses": {
          "200": {
            "description": "Geography hierarchy (+ optional SDOS bundle)"
          },
          "404": {
            "description": "No match"
          }
        }
      }
    },
    "/api/v1/tract/{geoid}": {
      "get": {
        "summary": "Cached SDOS bundle for a tract (all sources)",
        "parameters": [
          {
            "name": "geoid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "11-digit tract GEOID"
          },
          {
            "name": "refresh",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "acs_year",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lat",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Improves USDA food-access crosswalk"
          },
          {
            "name": "lon",
            "in": "query",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tract bundle"
          },
          "404": {
            "description": "No data"
          }
        }
      }
    },
    "/api/v1/tract/{geoid}/{slice}": {
      "get": {
        "summary": "Single-source slice of a tract bundle",
        "parameters": [
          {
            "name": "geoid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slice",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "acs",
                "health",
                "svi",
                "risk",
                "food",
                "environment"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source slice"
          },
          "404": {
            "description": "No data"
          }
        }
      }
    },
    "/api/v1/admin/tract/{geoid}/refresh": {
      "post": {
        "summary": "Force-refresh all sources for a tract (X-Admin-Key)",
        "parameters": [
          {
            "name": "geoid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Refreshed"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/api/v1/tiles": {
      "get": {
        "summary": "Catalog of Census boundary tile layers (which PMTiles are ingested in R2)",
        "responses": {
          "200": {
            "description": "Layer catalog"
          }
        }
      }
    },
    "/api/v1/tiles/{layer}.json": {
      "get": {
        "summary": "TileJSON 3.0 for one boundary layer",
        "parameters": [
          {
            "name": "layer",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "TileJSON"
          },
          "404": {
            "description": "Layer not ingested"
          }
        }
      }
    },
    "/api/v1/tiles/{layer}/{z}/{x}/{y}.pbf": {
      "get": {
        "summary": "A Mapbox Vector Tile of Census boundaries (from our R2)",
        "parameters": [
          {
            "name": "layer",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "tracts, counties, zcta, places, congressional, …"
          },
          {
            "name": "z",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "x",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "y",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "protobuf MVT"
          },
          "204": {
            "description": "Empty tile"
          },
          "404": {
            "description": "Layer not ingested"
          }
        }
      }
    }
  }
}