{
  "openapi": "3.0.3",
  "info": {
    "title": "urgentcaremap.health Public API",
    "description": "Free, open API for US urgent care center data. 8,500+ verified clinics across 386 cities and 50 states + DC. No authentication required. Licensed CC-BY-4.0.",
    "version": "1.0.0",
    "contact": {
      "name": "urgentcaremap.health",
      "url": "https://urgentcaremap.health/developers/"
    },
    "license": {
      "name": "CC-BY-4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    }
  },
  "externalDocs": {
    "description": "Developer Hub",
    "url": "https://urgentcaremap.health/developers/"
  },
  "servers": [
    {
      "url": "https://urgentcaremap.health/api/v1",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Meta",
      "description": "API metadata and stats"
    },
    {
      "name": "Directory",
      "description": "Clinics, cities, states, networks"
    }
  ],
  "paths": {
    "/index.json": {
      "get": {
        "tags": [
          "Meta"
        ],
        "summary": "API metadata and endpoint catalog",
        "operationId": "getApiIndex",
        "responses": {
          "200": {
            "description": "API root metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/stats.json": {
      "get": {
        "tags": [
          "Meta"
        ],
        "summary": "Aggregate statistics across entire dataset",
        "operationId": "getStats",
        "responses": {
          "200": {
            "description": "Site-wide stats",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Stats"
                }
              }
            }
          }
        }
      }
    },
    "/states.json": {
      "get": {
        "tags": [
          "Directory"
        ],
        "summary": "All US states with coverage metrics",
        "operationId": "getStates",
        "responses": {
          "200": {
            "description": "List of 50 states + DC",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatesList"
                }
              }
            }
          }
        }
      }
    },
    "/cities.json": {
      "get": {
        "tags": [
          "Directory"
        ],
        "summary": "All 386 cities with paths and clinic counts",
        "operationId": "getCities",
        "responses": {
          "200": {
            "description": "List of all cities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CitiesList"
                }
              }
            }
          }
        }
      }
    },
    "/cities/{state}.json": {
      "get": {
        "tags": [
          "Directory"
        ],
        "summary": "Cities in a specific state",
        "operationId": "getCitiesByState",
        "parameters": [
          {
            "name": "state",
            "in": "path",
            "required": true,
            "description": "State slug (e.g., california, new-york, district-of-columbia)",
            "schema": {
              "type": "string"
            },
            "example": "california"
          }
        ],
        "responses": {
          "200": {
            "description": "Cities in state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CitiesByState"
                }
              }
            }
          },
          "404": {
            "description": "State not found"
          }
        }
      }
    },
    "/clinics/{state}/{city}.json": {
      "get": {
        "tags": [
          "Directory"
        ],
        "summary": "All clinics in a specific city",
        "operationId": "getClinicsByCity",
        "parameters": [
          {
            "name": "state",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "massachusetts"
          },
          {
            "name": "city",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "boston"
          }
        ],
        "responses": {
          "200": {
            "description": "Clinics in city",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicsByCity"
                }
              }
            }
          },
          "404": {
            "description": "City not found"
          }
        }
      }
    },
    "/networks.json": {
      "get": {
        "tags": [
          "Directory"
        ],
        "summary": "All urgent care networks/brands",
        "operationId": "getNetworks",
        "responses": {
          "200": {
            "description": "List of networks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworksList"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Clinic": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "network": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "neighborhood": {
            "type": "string",
            "nullable": true
          },
          "coordinates": {
            "type": "string",
            "nullable": true,
            "description": "lat,lon"
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "hours": {
            "type": "object",
            "nullable": true
          },
          "services": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "insurance": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rating": {
            "type": "number",
            "nullable": true
          },
          "reviews_count": {
            "type": "integer",
            "nullable": true
          },
          "website": {
            "type": "string",
            "nullable": true,
            "format": "uri"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ClinicsByCity": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string"
          },
          "city": {
            "type": "object"
          },
          "meta": {
            "type": "object"
          },
          "count": {
            "type": "integer"
          },
          "clinics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Clinic"
            }
          }
        }
      },
      "CitiesList": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "cities": {
            "type": "array"
          }
        }
      },
      "CitiesByState": {
        "type": "object",
        "properties": {
          "state": {
            "type": "object"
          },
          "count": {
            "type": "integer"
          },
          "cities": {
            "type": "array"
          }
        }
      },
      "StatesList": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "states": {
            "type": "array"
          }
        }
      },
      "NetworksList": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "networks": {
            "type": "array"
          }
        }
      },
      "Stats": {
        "type": "object",
        "properties": {
          "coverage": {
            "type": "object"
          },
          "data_quality": {
            "type": "object"
          }
        }
      }
    }
  }
}