{"openapi":"3.1.0","info":{"title":"US Building Permits and Licenses Data (x402 & MCP)","version":"0.1.0","description":"US building permits, contractor and business licenses from 53 official US open-data sources by ZIP code, city or state, one row per entity.","x-guidance":"Structured real-time web intelligence APIs paid per delivered row in USDC via x402 on Base, Polygon, Arbitrum, Monad, World Chain and Solana. All endpoints are synchronous at POST /s/<site>/v1/<endpoint> and also exposed over stateless MCP at POST /mcp. Supports x402 v2 'upto' (Permit2) and 'exact' (EIP-3009) on EVM chains, and 'exact' (SPL USDC transfer, facilitator-paid fees) on Solana. 'upto' charges only for the rows delivered. 'exact' settles the full quoted amount (quoted rows x the row price) even when fewer rows than maxResults are delivered. Empty/0-row (404), invalid input (422), and upstream failures or timeouts (503, see error.code) are never charged.","contact":{"email":"ops@opendata.best"}},"servers":[{"url":"https://agensi.opendata.best"}],"paths":{"/s/us-permits-licenses/v1/search":{"post":{"operationId":"us_permits_licenses_search","summary":"US Building Permits and Licenses Data: Search US building permits and business licenses","description":"Query official US municipal building permits, contractor licenses and business licenses by ZIP code, city, state or source. Unit price: $0.002000/row USDC (default quote 10 rows, max 20 rows). Unsettled / 0-row / error responses are never charged.","tags":["us-permits-licenses","Data"],"x-payment-info":{"protocols":[{"x402":{}}],"price":{"mode":"dynamic","currency":"USD","amount":"0.020000"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"zipCodes":{"type":"array","items":{"type":"string"},"description":"US ZIP codes, for example 78701. Each ZIP code is one input. Only places covered by the sources return rows; the README lists them."},"cities":{"type":"array","items":{"type":"string"},"description":"Cities written as City, ST, for example Austin, TX or New Orleans, LA. Each city is one input."},"states":{"type":"array","items":{"type":"string"},"description":"Two-letter state codes such as NY or TX. Each state is one input and reads every source in that state (city, county and statewide), so add Record types to narrow it."},"sources":{"type":"array","items":{"type":"string","enum":["austin_permits","cambridge_ma_alteration_permits","cambridge_ma_new_construction_permits","chicago_permits","chicago_business_licenses","cincinnati_permits","colorado_professional_licenses","colorado_liquor_licenses","colorado_real_estate_licenses","delaware_business_licenses","delaware_professional_licenses","baton_rouge_permits","honolulu_permits","los_angeles_permits","los_angeles_occupancy_certificates","los_angeles_electrical_permits","los_angeles_mechanical_permits","marin_county_permits","mesa_permits","missouri_alcohol_licenses","montgomery_md_alcohol_licenses","montgomery_md_commercial_permits","montgomery_md_electrical_permits","montgomery_md_home_builder_licenses","montgomery_md_residential_permits","new_jersey_permits","new_orleans_permits","new_orleans_business_licenses","ny_barber_business_licenses","nyc_permits","nyc_bis_legacy_permits","nyc_electrical_permits","ny_contractor_registry","ny_dmv_facility_licenses","ny_elevator_contractor_licenses","ny_mold_contractor_licenses","ny_notary_commissions","ny_real_estate_licenses","ny_appraiser_licenses","ny_liquor_licenses","ny_liquor_applications","oregon_contractor_licenses","oregon_cannabis_licenses","oregon_liquor_licenses","prince_georges_md_permits","san_francisco_permits","seattle_permits","seattle_business_licenses","texas_sales_tax_permits","texas_alcohol_licenses","texas_insurance_agent_licenses","wa_cpa_licenses","wa_contractor_licenses"]},"description":"Without a place, each source you pick is one input and returns its newest records. With a place, only these sources are searched there. The two historical sources are read only when picked here."},"recordTypes":{"type":"array","items":{"type":"string","enum":["building_permit","electrical_permit","mechanical_permit","occupancy_certificate","business_license","contractor_license","alcohol_license","cannabis_license","professional_license","sales_tax_permit","facility_license"]},"description":"Kinds of records to return. Empty means all kinds except professional licenses, which are returned only when selected here or when you pick a professional license source."},"keyword":{"type":"string","description":"Words to find anywhere in the record, for example solar or restaurant. Keyword searches are slower on large sources; add a date range to keep them fast."},"dateFrom":{"type":"string","description":"Only records dated on or after this day: a date (YYYY-MM-DD) or a window such as 30 days, counted back from today. Permits use the issue date; licenses use the date each source keeps. Sources without a record date are skipped when a date is set."},"dateTo":{"type":"string","description":"Only records dated on or before this day: a date (YYYY-MM-DD) or a window such as 7 days, counted back from today."},"permitTypes":{"type":"array","items":{"type":"string","enum":["roofing","hvac","electrical","plumbing","solar","new_construction","renovation","demolition","mechanical","fire_protection","other"]},"description":"Kinds of work, for permits only. Each permit gets one kind from its source's own wording."},"permitStatuses":{"type":"array","items":{"type":"string","enum":["issued","pending","expired","revoked","completed","cancelled"]},"description":"Permit statuses to keep, for permits only."},"minEstimatedCost":{"type":"integer","description":"Only permits with a stated job value of at least this many US dollars. Permits without a job value are left out when this is set.","minimum":0},"maxEstimatedCost":{"type":"integer","description":"Only permits with a stated job value of at most this many US dollars.","minimum":0},"licenseStatuses":{"type":"array","items":{"type":"string","enum":["active","inactive","suspended","expired","pending"]},"description":"License statuses to keep, for licenses only."},"sortBy":{"type":"string","description":"Newest records first or oldest first, by record date. Records of sources without a record date come after the dated ones.","default":"newest","enum":["newest","oldest"]},"maxResults":{"type":"integer","description":"Most rows this call returns, 1 to 20 (default 10). All row types count toward it. The 402 payment quote is maxResults x $0.0020/row USDC: with the upto scheme you pay only for the rows delivered, with exact you pay the quoted amount. Calls that return 0 rows or fail are not charged.","minimum":1,"maximum":20,"default":10},"includeRawFields":{"type":"boolean","description":"Add the record exactly as the source published it, under raw (up to 64 KiB per row).","default":false}},"additionalProperties":false},"example":{"zipCodes":["78701"],"sortBy":"newest","includeRawFields":false,"maxResults":10}}}},"responses":{"200":{"description":"Synchronous data rows with x402 PAYMENT-RESPONSE receipt header.","headers":{"PAYMENT-RESPONSE":{"description":"Base64-encoded x402 v2 SettleResponse receipt.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response_us_permits_licenses"},"example":{"jobId":"job_us-permi_example","status":"succeeded","done":true,"rowCount":1,"rowsBilled":1,"rowsDelivered":1,"rows":[{"rowType":"example_rowType","recordType":"example_recordType","recordDate":"example_recordDate","status":"example_status","permitType":"example_permitType","licenseType":"example_licenseType"}],"meta":{"site":"us-permits-licenses","endpoint":"search","maxResults":10,"payment":{"scheme":"upto","network":"eip155:8453","quotedMicrousd":20000,"settledMicrousd":2000,"transaction":"0x0000000000000000000000000000000000000000000000000000000000000000"}}}}}},"402":{"description":"Payment required or invalid/declined payment authorization (never charged).","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired quote.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"no_results: 0 rows matched the query; aborted before settlement (charged=false).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"payment_id_conflict: payment-identifier reused with different parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid or missing request parameters (validated before /verify; charged=false).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or payer cooldown exceeded (charged=false).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"error.code collection_failed / source_blocked (upstream source failed or blocked) or upstream_timeout (synchronous deadline reached, task cancelled): charged=false. Also settlement_pending or facilitator_unavailable; retry same payment to reconcile.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/s/us-permits-licenses/v1/health":{"get":{"operationId":"us_permits_licenses_health","summary":"US Building Permits and Licenses Data: health check","description":"Free readiness check (never returns 402 and never starts a collection).","tags":["us-permits-licenses","health"],"responses":{"200":{"description":"Operational","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}}}}}},"components":{"schemas":{"ErrorDetail":{"type":"object","required":["code","message","retryable"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"charged":{"type":"boolean"}}},"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"HealthStatus":{"type":"object","required":["ok","site","status","endpoints","rowsBilled"],"properties":{"ok":{"type":"boolean"},"site":{"type":"string"},"status":{"type":"string","enum":["operational","unavailable"]},"endpoints":{"type":"array","items":{"type":"string"}},"rowsBilled":{"type":"integer"}}},"Row_us_permits_licenses":{"type":"object","properties":{"rowType":{"type":["string","null"],"title":"Row"},"recordType":{"type":["string","null"],"title":"Record type"},"recordDate":{"type":["string","null"],"title":"Date"},"status":{"type":["string","null"],"title":"Status"},"permitType":{"type":["string","null"],"title":"Permit type"},"licenseType":{"type":["string","null"],"title":"License type"},"holderName":{"type":["string","null"],"title":"Holder"},"description":{"type":["string","null"],"title":"Description"},"estimatedCost":{"type":["number","null"],"title":"Estimated cost (USD)"},"address.full":{"type":["string","null"],"title":"Address"},"sourceName":{"type":["string","null"],"title":"Source"},"sourceUrl":{"type":["string","null"],"format":"uri","title":"Record page"}},"additionalProperties":true},"Response_us_permits_licenses":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string"},"done":{"type":"boolean"},"rowCount":{"type":"integer","minimum":1},"rowsBilled":{"type":"integer","minimum":1},"rowsDelivered":{"type":"integer","minimum":1},"rows":{"type":"array","items":{"$ref":"#/components/schemas/Row_us_permits_licenses"}},"meta":{"type":"object","properties":{"site":{"type":"string"},"endpoint":{"type":"string"},"maxResults":{"type":"integer"},"payment":{"type":"object","properties":{"scheme":{"type":"string"},"network":{"type":"string"},"quotedMicrousd":{"type":"integer"},"settledMicrousd":{"type":"integer"},"transaction":{"type":"string"},"payer":{"type":"string"}}}}}},"required":["jobId","status","done","rowCount","rows"]}}}}