{
  "schema_version": "1.0",
  "name": "npi-provider-directory",
  "display_name": "NPI Provider Directory Search",
  "description": "Searches and retrieves structured healthcare provider records from the CMS NPPES public registry (no API key required). Supports single NPI lookup by number or provider search by name, state, city, and specialty. Returns entity type, name, credentials, primary specialty, taxonomy code, practice address, phone, status, and NPI enrollment date.",
  "endpoint": "https://bacapi-npi-directory-api.workers.dev/npi",
  "method": "GET",
  "payment": {
    "protocol": "x402",
    "network":  "base",
    "currency": "USDC",
    "amount":   "0.08"
  },
  "routes": [
    {
      "path":        "/npi/lookup",
      "description": "Look up a single provider by their 10-digit NPI number",
      "parameters": {
        "npi": "string — 10-digit NPI number (required)"
      }
    },
    {
      "path":        "/npi/search",
      "description": "Search providers by name, organization, state, city, or specialty",
      "parameters": {
        "name":        "string — individual provider last (and optionally first) name",
        "org":         "string — organization name",
        "state":       "string — 2-letter state abbreviation",
        "city":        "string — city name",
        "specialty":   "string — specialty description (e.g. 'Family Medicine', 'Cardiology')",
        "entity_type": "string — 'individual' or 'org'",
        "limit":       "integer — results per page, max 50 (default 10)",
        "skip":        "integer — pagination offset (default 0)"
      }
    }
  ],
  "response_shape": {
    "lookup": {
      "action": "lookup",
      "result": {
        "npi":           "string",
        "entity_type":   "Individual | Organization",
        "name":          "string",
        "credential":    "string | null — e.g. 'MD', 'DO', 'NP'",
        "specialty":     "string | null — human-readable specialty",
        "taxonomy_code": "string | null",
        "address":       "{ street, city, state, zip, country }",
        "phone":         "string | null",
        "status":        "string | null",
        "enumeration_date": "string | null"
      }
    },
    "search": {
      "action":       "search",
      "result_count": "integer",
      "skip":         "integer",
      "limit":        "integer",
      "results":      "Array of provider objects (same shape as lookup result)"
    }
  },
  "example_request": "GET /npi/lookup?npi=1234567893",
  "example_response": {
    "data": {
      "action": "lookup",
      "result": {
        "npi":          "1234567893",
        "entity_type":  "Individual",
        "name":         "Jane Smith",
        "credential":   "MD",
        "specialty":    "Family Medicine",
        "taxonomy_code":"207Q00000X",
        "address": { "street": "123 Main St", "city": "Portland", "state": "OR", "zip": "97201" },
        "phone":        "503-555-0100",
        "status":       "A",
        "enumeration_date": "2005-03-14"
      }
    },
    "meta": { "source": "CMS NPPES Public Registry", "priced_at": "0.08 USDC" }
  },
  "tags": ["npi","healthcare","provider","nppes","cms","physician","hospital","directory","medical"],
  "category": "healthcare"
}
