{
 "openapi": "3.1.0",
 "info": {
  "title": "Isopleth API",
  "description": "Isopleth location data API: public-dataset facts for any US point, one call. Each field carries its source, license and attribution. Metered in lookups: one location x up to 50 fields = 1 lookup.",
  "version": "1.0.0",
  "termsOfService": "https://isopleth.dev/legal/terms",
  "contact": {
   "email": "support@isopleth.dev",
   "url": "https://isopleth.dev/docs/"
  }
 },
 "paths": {
  "/v1/meta/fields": {
   "get": {
    "summary": "Field catalog, presets and per-source licensing (free)",
    "operationId": "meta_fields_v1_meta_fields_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    }
   }
  },
  "/v1/usage": {
   "get": {
    "summary": "Plan, limits, balance and recent usage for this key's account (free)",
    "operationId": "usage_v1_usage_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    }
   }
  },
  "/v1/geocode": {
   "post": {
    "summary": "Geocode a US address (1 lookup when it resolves)",
    "operationId": "geocode_v1_geocode_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/GeocodeRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/fetch": {
   "post": {
    "summary": "Fields for one location",
    "operationId": "fetch_v1_fetch_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/FetchRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/fetch/batch": {
   "post": {
    "summary": "Same fields for up to N locations (plan limit); results index-aligned",
    "operationId": "fetch_batch_v1_fetch_batch_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/BatchRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "BatchRequest": {
    "properties": {
     "locations": {
      "items": {
       "$ref": "#/components/schemas/Location"
      },
      "type": "array",
      "maxItems": 100,
      "minItems": 1,
      "title": "Locations"
     },
     "fields": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Fields"
     },
     "preset": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Preset"
     },
     "extras": {
      "type": "boolean",
      "title": "Extras",
      "default": false
     },
     "max_wait_s": {
      "anyOf": [
       {
        "type": "number",
        "maximum": 600.0,
        "minimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Max Wait S"
     }
    },
    "type": "object",
    "required": [
     "locations"
    ],
    "title": "BatchRequest"
   },
   "FetchRequest": {
    "properties": {
     "lat": {
      "anyOf": [
       {
        "type": "number",
        "maximum": 90.0,
        "minimum": -90.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Lat",
      "description": "WGS84 latitude"
     },
     "lng": {
      "anyOf": [
       {
        "type": "number",
        "maximum": 180.0,
        "minimum": -180.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Lng",
      "description": "WGS84 longitude"
     },
     "address": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 256,
        "minLength": 1
       },
       {
        "type": "null"
       }
      ],
      "title": "Address",
      "description": "US street address (geocoded)"
     },
     "fields": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Fields",
      "description": "Field names (see /v1/meta/fields). Up to 50 outside a preset."
     },
     "preset": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Preset",
      "description": "Named field bundle (see /v1/meta/fields presets)"
     },
     "extras": {
      "type": "boolean",
      "title": "Extras",
      "description": "Include per-field timing and cache details",
      "default": false
     },
     "max_wait_s": {
      "anyOf": [
       {
        "type": "number",
        "maximum": 600.0,
        "minimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Max Wait S",
      "description": "Upper bound on upstream wait; clamped to the plan cap"
     }
    },
    "type": "object",
    "title": "FetchRequest",
    "description": "Give either lat+lng or address, plus fields and/or a preset."
   },
   "GeocodeRequest": {
    "properties": {
     "address": {
      "type": "string",
      "maxLength": 256,
      "minLength": 1,
      "title": "Address"
     }
    },
    "type": "object",
    "required": [
     "address"
    ],
    "title": "GeocodeRequest"
   },
   "HTTPValidationError": {
    "properties": {
     "detail": {
      "items": {
       "$ref": "#/components/schemas/ValidationError"
      },
      "type": "array",
      "title": "Detail"
     }
    },
    "type": "object",
    "title": "HTTPValidationError"
   },
   "Location": {
    "properties": {
     "lat": {
      "anyOf": [
       {
        "type": "number",
        "maximum": 90.0,
        "minimum": -90.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Lat"
     },
     "lng": {
      "anyOf": [
       {
        "type": "number",
        "maximum": 180.0,
        "minimum": -180.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Lng"
     },
     "address": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 256,
        "minLength": 1
       },
       {
        "type": "null"
       }
      ],
      "title": "Address"
     }
    },
    "type": "object",
    "title": "Location"
   },
   "ValidationError": {
    "properties": {
     "loc": {
      "items": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "integer"
        }
       ]
      },
      "type": "array",
      "title": "Location"
     },
     "msg": {
      "type": "string",
      "title": "Message"
     },
     "type": {
      "type": "string",
      "title": "Error Type"
     },
     "input": {
      "title": "Input"
     },
     "ctx": {
      "type": "object",
      "title": "Context"
     }
    },
    "type": "object",
    "required": [
     "loc",
     "msg",
     "type"
    ],
    "title": "ValidationError"
   }
  },
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   },
   "apiKeyHeader": {
    "type": "apiKey",
    "in": "header",
    "name": "X-API-Key"
   }
  }
 },
 "servers": [
  {
   "url": "https://api.isopleth.dev"
  }
 ],
 "security": [
  {
   "bearer": []
  },
  {
   "apiKeyHeader": []
  }
 ]
}