{
  "openapi": "3.1.0",
  "info": {
    "title": "ToolMint Census Geocode",
    "version": "0.1.0",
    "description": "US Census Geocoder as clean agent JSON. Pay per call with USDC on Base via x402. This product uses the Census Bureau Geocoder and Data API but is not endorsed or certified by the Census Bureau.",
    "x-guidance": "Use GET /geocode?address=<one-line US address> to get coordinates and FIPS codes (state, county, tract, block group, block, districts). Use GET /reverse?lat=&lon= for a point. County FIPS feeds HUD FMR / income limits; lat/lon feeds FEMA flood zone and NWS alerts. Unpaid calls get 402 with x402 requirements (USDC on Base). No-match/ambiguous/upstream errors are not charged.",
    "contact": {
      "email": "toolmint.dev@gmail.com",
      "name": "ToolMint"
    }
  },
  "paths": {
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Liveness",
        "security": [],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/geocode": {
      "get": {
        "operationId": "census_geocode_address",
        "summary": "Geocode a US address to coordinates + Census FIPS geographies",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "network": "eip155:8453",
          "payTo": "0xfbF7413bcB3a604936775C96FDbe0b0C9c9E37F5",
          "asset": "USDC",
          "scheme": "exact",
          "amountAtomic": "5000"
        },
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Match JSON"
          },
          "400": {
            "description": "Bad input (no charge; rejected before payment)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "No match (not charged)"
          },
          "409": {
            "description": "Ambiguous address with candidates (not charged)"
          },
          "502": {
            "description": "Census Geocoder unavailable (not charged)"
          }
        }
      }
    },
    "/reverse": {
      "get": {
        "operationId": "census_reverse_point",
        "summary": "Census FIPS geographies for a lat/lon point",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "network": "eip155:8453",
          "payTo": "0xfbF7413bcB3a604936775C96FDbe0b0C9c9E37F5",
          "asset": "USDC",
          "scheme": "exact",
          "amountAtomic": "5000"
        },
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            }
          },
          {
            "name": "lon",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Geographies JSON"
          },
          "400": {
            "description": "Bad input (no charge; rejected before payment)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "No match (not charged)"
          },
          "502": {
            "description": "Census Geocoder unavailable (not charged)"
          }
        }
      }
    }
  }
}