# Pennsylvania Sales Tax Licenses Scraper (`coder_zoro/pennsylvania-sales-tax-licenses-scraper`) Actor

Pennsylvania Sales Tax Licenses Scraper is a Python tool to extract legal business names, trade names (DBAs), Sales, Use, and Hotel Occupancy Tax license numbers, license statuses, and business addresses from the Pennsylvania Open Data portal

- **URL**: https://apify.com/coder_zoro/pennsylvania-sales-tax-licenses-scraper.md
- **Developed by:** [Zoro](https://apify.com/coder_zoro) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Pennsylvania Sales Tax Licenses Scraper — Business License Records Extraction

![Pennsylvania Sales Tax Licenses Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/pennsylvania-sales-tax-licenses-scraper-cover.png)

Collect Pennsylvania sales, use, and hotel tax license records from Commonwealth of Pennsylvania public datasets. Retrieve business names, trade names, license types, account identifiers, addresses, counties, and expiration dates. Export the collected records as structured JSON, CSV, or Excel datasets.

### Overview

The Pennsylvania Sales Tax Licenses Scraper helps researchers, analysts, compliance teams, and developers find businesses holding sales tax licenses in Pennsylvania.

Choose between keyword search, custom filtering, and newest-first collection to retrieve the records you need. Results are saved to your Apify dataset for company research, compliance checks, reporting, and data enrichment.

### Features

- **Business name search:** Find license holders using keywords and business names.
- **Custom filtering:** Narrow records by county, expiration date, or other available fields.
- **Latest records:** Retrieve records ordered by expiration date, newest first.
- **Business identification:** Collect legal names, trade names, and account identifiers.
- **License information:** Retrieve license types and expiration dates.
- **Location details:** Collect counties, street addresses, cities, states, and postal codes.
- **Configurable collection:** Set a maximum number of records per run.
- **Dataset exports:** Export results in JSON, CSV, Excel, and other supported formats.

### Collection Modes

**1. Search Mode**

Search license records using keywords or business-related terms. For example, search for `LANCASTER` to find matching records.

**2. Filter Mode**

Apply custom conditions to narrow results by county, expiration date, or other available fields.

**3. Latest Mode**

Collect records ordered by `expiration_date` in descending order, placing the latest expiration dates first.

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `mode` | String | `search` | Collection mode: `search`, `filter`, or `latest`. |
| `searchText` | String | Empty | Keyword or phrase used to search license records. |
| `where` | String | Empty | Optional filter condition for selecting records. |
| `maxItems` | Integer | 100 | Maximum number of records to collect. |
| `requestDelayMs` | Integer | 1000 | Delay between requests in milliseconds. |

### Example Input

**Latest Mode**

```json
{
  "mode": "latest",
  "maxItems": 50,
  "requestDelayMs": 1000
}
```

**Search Mode**

```json
{
  "mode": "search",
  "searchText": "LANCASTER",
  "maxItems": 25,
  "requestDelayMs": 1000
}
```

**Filter Mode**

```json
{
  "mode": "filter",
  "where": "county = 'LANCASTER'",
  "maxItems": 25,
  "requestDelayMs": 1000
}
```

### What Data Does This Actor Extract?

The actor collects business license and location information, including:

| Field | Description |
|---|---|
| `county` | County associated with the license record |
| `legal_name` | Registered legal business name |
| `trade_name` | Business or trade name |
| `postal_code` | Business postal code |
| `country` | Country |
| `account` | Business account identifier |
| `license_type` | Type of tax license |
| `expiration_date` | License expiration date |
| `street_address` | Business street address |
| `city` | Business city |
| `state` | State abbreviation |
| `scrapedAt` | Date and time the record was collected |

### Example Output

```json
{
  "county": "LANCASTER",
  "legal_name": "MATT JONES WOODTURNING",
  "trade_name": "MATT JONES WOODTURNING",
  "postal_code": "17512",
  "country": "USA",
  "account": "67**2166",
  "license_type": "Sales License/Retail",
  "expiration_date": "2031-05-31T00:00:00.000",
  "street_address": "KEEN AVE",
  "city": "COLUMBIA",
  "state": "PA",
  "scrapedAt": "2026-10-26T00:00:00+00:00"
}
```

### Use Cases

- **Business research:** Find Pennsylvania businesses and review their license types and locations.
- **Compliance checks:** Examine publicly available license records and compare them with internal business datasets.
- **Lead generation:** Build business prospect lists using legal names, trade names, and location details.
- **Market research:** Analyse license holders by county, city, or license type.
- **License monitoring:** Repeat collections and compare expiration dates over time.
- **Data enrichment:** Add business license and address information to existing company databases.

### Working with Your Dataset

After the actor completes a run, access your collected records in the Apify dataset.

Export your results in formats such as:

- JSON
- CSV
- Excel
- Other supported Apify dataset formats

Use the exported records for business research, reporting, compliance workflows, or further data processing.

### FAQ

**Who is this actor for?**

It is designed for analysts, compliance teams, researchers, and developers who need structured Pennsylvania sales tax license records.

**What collection modes are available?**

You can choose Search, Filter, or Latest mode depending on how you want to retrieve license records.

**How do I get the latest expiration dates?**

Select `latest` mode. Records are ordered by `expiration_date` in descending order.

**Can I filter records by county?**

Yes. Use `filter` mode and provide a condition through the `where` parameter.

**Can I export the results to Excel or CSV?**

Yes. You can export your Apify dataset in CSV, Excel, JSON, and other supported formats.

**Can I run it on a schedule?**

Yes. Configure Apify schedules to refresh your license dataset at your preferred intervals.

### Disclaimer

This Actor is an independent tool and is not affiliated with, endorsed by, sponsored by, or officially associated with the Commonwealth of Pennsylvania or its owners. It collects information from publicly available records. Users are responsible for ensuring that their use of collected data complies with applicable laws and relevant terms.

### Is Web Scraping Legal?

Collecting information that is already public is generally legal. There is no single law that bans all forms of web scraping. The limits are the usual ones: do not break into accounts, do not take private or confidential data, and be careful with personal data and copyrighted works. A site's terms can also restrict how you access it. Facts such as a public name, price, or rating are not the same as republishing someone's article or photo.

This actor collects information from public pages. It does not log in and it does not bypass access controls.

For a longer explanation, see Apify's article [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

## `mode` (type: `string`):

What to fetch. Search uses full-text $q, filter uses SoQL $where, latest orders by expiration_date descending.

## `searchText` (type: `string`):

Full-text query sent as $q (search mode).

## `where` (type: `string`):

Raw SoQL $where clause, e.g. county = 'LANCASTER' (filter mode).

## `orderBy` (type: `string`):

SoQL $order override, e.g. expiration_date DESC. Latest mode defaults to expiration_date DESC.

## `maxItems` (type: `integer`):

Stop after this many successful rows. Hard max is 1000.

## `requestDelayMs` (type: `integer`):

Polite pacing in milliseconds. Raise if you see HTTP 429.

## `userAgent` (type: `string`):

User-Agent header sent with each request.

## `timeoutSecs` (type: `integer`):

Overall run budget in seconds.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

## `proxyConfiguration` (type: `object`):

Optional proxy. Leave off unless you need it.

## Actor input object example

```json
{
  "mode": "latest",
  "searchText": "LANCASTER",
  "where": "county = 'LANCASTER'",
  "orderBy": "",
  "maxItems": 100,
  "requestDelayMs": 1000,
  "userAgent": "ActorResearch/1.0",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset rows in the overview table.

## `dataset` (type: `string`):

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchText": "LANCASTER"
};

// Run the Actor and wait for it to finish
const run = await client.actor("coder_zoro/pennsylvania-sales-tax-licenses-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "searchText": "LANCASTER" }

# Run the Actor and wait for it to finish
run = client.actor("coder_zoro/pennsylvania-sales-tax-licenses-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchText": "LANCASTER"
}' |
apify call coder_zoro/pennsylvania-sales-tax-licenses-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,coder_zoro/pennsylvania-sales-tax-licenses-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/wNQ26iWnOVdfmN8e2/builds/WGa9oILomia0cuKta/openapi.json
