{
  "schema_version": "1.0",
  "name": "location-lookup",
  "display_name": "ZIP Code Location Lookup",
  "description": "Resolves a 5-digit US ZIP code to city, county, FIPS code, lat/lng coordinates, IANA timezone, congressional district, and area codes. Data from US Census Geocoding API. Cached 30 days.",
  "endpoint": "https://bacapi-location-api.workers.dev/location",
  "method": "GET",
  "payment": {
    "protocol": "x402",
    "network":  "base",
    "currency": "USDC",
    "amount":   "0.07"
  },
  "parameters": {
    "zip": {
      "type":        "string",
      "required":    true,
      "description": "5-digit US ZIP code",
      "example":     "90210"
    }
  },
  "response_shape": {
    "zip":                  "string",
    "city":                 "string",
    "county":               "string",
    "state":                "string",
    "state_abbr":           "string",
    "fips_state":           "string — 2-digit FIPS",
    "fips_county":          "string — 5-digit FIPS",
    "lat":                  "number",
    "lng":                  "number",
    "timezone":             "string — IANA timezone (e.g. America/New_York)",
    "congressional_district":"string",
    "area_codes":           "string[] — NPA area codes for the state"
  },
  "example_request": "GET /location?zip=90210",
  "example_response": {
    "data": {
      "zip": "90210",
      "city": "Beverly Hills",
      "county": "Los Angeles",
      "state": "California",
      "state_abbr": "CA",
      "fips_state": "06",
      "fips_county": "06037",
      "lat": 34.0901,
      "lng": -118.4065,
      "timezone": "America/Los_Angeles",
      "congressional_district": "33",
      "area_codes": ["213","310","323","424","442","562","619","626","628","657","661","714","747","760","805","818","909","949"]
    },
    "meta": {
      "source": "US Census Geocoding API",
      "priced_at": "0.07 USDC"
    }
  },
  "tags": ["geocoding","zip","location","census","fips","timezone","geography"],
  "category": "geography"
}
