{
  "openapi": "3.0.1",
  "info": {
    "title": "Pennsylvania PALS License Verification Scraper",
    "description": "Search Pennsylvania's PALS (BPOA Portal) public professional license registry by name, license number, profession/board, or facility. No login required.",
    "version": "1.0",
    "x-build-id": "qPYlUbalPmRKm4QBo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~pennsylvania-pals-license-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-pennsylvania-pals-license-search-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/crawlerbros~pennsylvania-pals-license-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-pennsylvania-pals-license-search-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/crawlerbros~pennsylvania-pals-license-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-pennsylvania-pals-license-search-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Search mode",
            "enum": [
              "byName",
              "byLicenseNumber",
              "byProfession",
              "byFacility"
            ],
            "type": "string",
            "description": "How to search the PALS licensee registry.",
            "default": "byName"
          },
          "lastName": {
            "title": "Last name (mode=byName)",
            "type": "string",
            "description": "Licensee last name. PALS name searches are starts-with matches, same as the official site. Leave empty to search by firstName alone. If mode=byName and every filter is left empty, the actor falls back to a demo name (\"Smith\") so the daily test run still returns data.",
            "default": ""
          },
          "firstName": {
            "title": "First name (mode=byName)",
            "type": "string",
            "description": "Optional first name to narrow a last-name search."
          },
          "middleName": {
            "title": "Middle name (mode=byName)",
            "type": "string",
            "description": "Optional middle name/initial to narrow a last-name search."
          },
          "licenseNumber": {
            "title": "License number (mode=byLicenseNumber)",
            "type": "string",
            "description": "Exact PALS license number, e.g. `AA002213L`."
          },
          "facilityName": {
            "title": "Facility / business name (mode=byFacility)",
            "type": "string",
            "description": "Search by facility, firm, or business name instead of an individual's name."
          },
          "facilityStreetAddress": {
            "title": "Facility street address (mode=byFacility, optional)",
            "type": "string",
            "description": "Optional street address to narrow a facility-name search."
          },
          "profession": {
            "title": "Profession / board (mode=byProfession, optional filter otherwise)",
            "enum": [
              "",
              "3",
              "1",
              "31",
              "15",
              "5",
              "2",
              "20",
              "41",
              "13",
              "28",
              "17",
              "10",
              "7",
              "12",
              "37",
              "6",
              "43",
              "24",
              "9",
              "26",
              "36",
              "8",
              "42",
              "33",
              "30",
              "39",
              "27",
              "29",
              "40",
              "35",
              "38",
              "23"
            ],
            "type": "string",
            "description": "The PALS board/profession category. Required for mode=byProfession; optionally narrows byName/byFacility searches too.",
            "default": ""
          },
          "licenseType": {
            "title": "License type within profession (optional)",
            "type": "string",
            "description": "Free-text sub-type within the selected profession, e.g. `Certified Public Accountant`, `Real Estate Salesperson`, `Registered Nurse`. Matched case-insensitively against each result's license type. Only meaningful together with `profession`."
          },
          "city": {
            "title": "City",
            "type": "string",
            "description": "City filter, e.g. `Philadelphia`, `Pittsburgh`, `Erie`. Optional for byName / byFacility / byProfession."
          },
          "zip": {
            "title": "ZIP code",
            "type": "string",
            "description": "5-digit ZIP code filter. Optional for byName / byFacility / byProfession."
          },
          "county": {
            "title": "Pennsylvania county",
            "enum": [
              "",
              "Adams",
              "Allegheny",
              "Armstrong",
              "Beaver",
              "Bedford",
              "Berks",
              "Blair",
              "Bradford",
              "Bucks",
              "Butler",
              "Cambria",
              "Cameron",
              "Carbon",
              "Centre",
              "Chester",
              "Clarion",
              "Clearfield",
              "Clinton",
              "Columbia",
              "Crawford",
              "Cumberland",
              "Dauphin",
              "Delaware",
              "Elk",
              "Erie",
              "Fayette",
              "Forest",
              "Franklin",
              "Fulton",
              "Greene",
              "Huntingdon",
              "Indiana",
              "Jefferson",
              "Juniata",
              "Lackawanna",
              "Lancaster",
              "Lawrence",
              "Lebanon",
              "Lehigh",
              "Luzerne",
              "Lycoming",
              "McKean",
              "Mercer",
              "Mifflin",
              "Monroe",
              "Montgomery",
              "Montour",
              "Northampton",
              "Northumberland",
              "Perry",
              "Philadelphia",
              "Pike",
              "Potter",
              "Schuylkill",
              "Snyder",
              "Somerset",
              "Sullivan",
              "Susquehanna",
              "Tioga",
              "Union",
              "Venango",
              "Warren",
              "Washington",
              "Wayne",
              "Westmoreland",
              "Wyoming",
              "York"
            ],
            "type": "string",
            "description": "Filter results to a single Pennsylvania county (applied after search, since PALS also returns out-of-state licensees).",
            "default": ""
          },
          "state": {
            "title": "State",
            "enum": [
              "",
              "Alabama",
              "Alaska",
              "Arizona",
              "Arkansas",
              "California",
              "Colorado",
              "Connecticut",
              "Delaware",
              "District of Columbia",
              "Florida",
              "Georgia",
              "Hawaii",
              "Idaho",
              "Illinois",
              "Indiana",
              "Iowa",
              "Kansas",
              "Kentucky",
              "Louisiana",
              "Maine",
              "Maryland",
              "Massachusetts",
              "Michigan",
              "Minnesota",
              "Mississippi",
              "Missouri",
              "Montana",
              "Nebraska",
              "Nevada",
              "New Hampshire",
              "New Jersey",
              "New Mexico",
              "New York",
              "North Carolina",
              "North Dakota",
              "Ohio",
              "Oklahoma",
              "Oregon",
              "Pennsylvania",
              "Rhode Island",
              "South Carolina",
              "South Dakota",
              "Tennessee",
              "Texas",
              "Utah",
              "Vermont",
              "Virginia",
              "Washington",
              "West Virginia",
              "Wisconsin",
              "Wyoming"
            ],
            "type": "string",
            "description": "Filter results to a single US state (applied after search, since PALS' name/facility/profession searches also return out-of-state licensees holding a PA license).",
            "default": ""
          },
          "statusFilter": {
            "title": "License status filter",
            "enum": [
              "any",
              "active",
              "inactive",
              "expired",
              "nullAndVoid"
            ],
            "type": "string",
            "description": "Filter results by license status.",
            "default": "any"
          },
          "fetchDetails": {
            "title": "Fetch full detail record per result",
            "type": "boolean",
            "description": "Enrich each result with its detail record (issue date, expiration date, last renewal date, disciplinary actions, restrictions). Uses one extra request per result.",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Hard cap on emitted license records.",
            "default": 20
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed in normal operation (pals.pa.gov is publicly reachable). Used automatically as a fallback only if the source starts blocking direct requests.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}