Purpose
Search and return Pennsylvania registered business entities from the official Commonwealth open-data catalog, using the distinct-business view and its Socrata API endpoint.
When to Use
Use when the caller needs to find registered Pennsylvania businesses by a name, keyword, or other full-text business-entity term. Use the current-by-county dataset instead when county-level registration records rather than distinct entities are required.
Workflow
- Construct the single-navigation Socrata API URL, URL-encoding the caller's search text:
https://data.pa.gov/resource/3urc-uaba.json?$q={encoded-query}&$limit={limit}. Use a practical default such as100; omit$qfor an unfiltered browse. gotothat URL withwaitUntil: domcontentloaded, then run the following evaluator on the loaded API response:
(() => {
const text = document.body?.innerText?.trim() || "";
let payload;
try {
payload = JSON.parse(text);
} catch (_) {
return { rows: [], error: "Expected a Socrata JSON response" };
}
const rows = Array.isArray(payload)
? payload
: Array.isArray(payload.data)
? payload.data
: [];
return { rows, count: rows.length };
})();- Preserve the returned row objects as-is; field names are dataset-defined and should be inspected from the response rather than guessed. The human-facing distinct-business view is
https://data.pa.gov/Licenses-Certificates/Filtered-View-Distinct-Registered-Businesses-in-PA/3urc-uaba/about_data.
Site-Specific Gotchas
- This is a Socrata catalog: the opaque resource ID
3urc-uabais the direct API key for the distinct registered-business view; do not rely on the long display title. - The related source dataset for current records by county/department is
xvd7-5r2c, available athttps://data.pa.gov/resource/xvd7-5r2c.jsonandhttps://data.pa.gov/Licenses-Certificates/Registered-Businesses-in-PA-Current-by-County-Depa/xvd7-5r2c. $qperforms Socrata full-text matching across the view. For exact field filtering, first inspect returned keys or the dataset metadata rather than assuming a column name.- Keep
$limitexplicit because the API response is paginated by request size; issue additional requests with$offset={n}when the caller needs more than one page. - The API response is JSON rendered in the browser document, so parse
document.body.innerText; do not use an LLM page scraper for structured extraction.
Expected Output
An object of the form { rows: [...], count: number }, where each row is one JSON business-entity record returned by the distinct registered-business view.