# Philadelphia City Contracts and Bids Scraper (PHLContracts) (`talcoe/philadelphia-contracts`) Actor

Scrape open Philadelphia city bid solicitations from PHLContracts with department, commodity category, buyer and opening date, filtered by keyword, department, category or due date, and billed per result.

- **URL**: https://apify.com/talcoe/philadelphia-contracts.md
- **Developed by:** [M Usama](https://apify.com/talcoe) (community)
- **Categories:** Business, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 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.

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

### What does Philadelphia City Contracts and Bids Scraper do?

It pulls every open bid solicitation from PHLContracts, the City of Philadelphia procurement portal, and returns one clean record per solicitation. Each record has the bid number, title, the department that is buying, the commodity category, the buyer, the opening date and a link to the solicitation page. Filters for keyword, department, category and due date keep the run small, and you pay per result.

### Data source

The Actor reads the public open bids search on phlcontracts.phila.gov, the same list any visitor sees without an account, so every run reflects what is open that day.

### Why use it?

- Find out which city departments are buying right now and what they are buying, without clicking through 25 rows at a time.
- Set a keyword such as paving, laptops or catering and get only the solicitations that match.
- Sort by opening date and see what is due this week, so a small vendor can still quote in time.
- Schedule a daily run and send new bid numbers to Slack, Google Sheets or a webhook.
- Replace a manual copy and paste routine or a paid bid alert service with one run.

### How to use it

1. Open the Actor and set the filters, or leave them empty to get every open solicitation.
2. Click Start. Download the results as JSON, CSV or Excel, or read them through the API.
3. Add a Schedule and an Integration (Slack, Google Sheets, webhook) to get new records automatically.

### Input

| Field | Description |
|---|---|
| `keywords` | Keep solicitations whose title, bid number or buyer contains any of these words. |
| `department` | Keep only solicitations from a department whose name contains this text, for example Water or Free Library. |
| `category` | Keep only solicitations in a commodity category whose name contains this text, for example Construction. |
| `dueWithinDays` | Keep only solicitations that open within this many days. 0 means no limit. |
| `includeContactDetails` | Open each solicitation page to add contact email, purchase method, type code and location. Slower, see Limitations. |
| `maxResults` | Hard stop for the run. You are billed per result, so this caps the cost. |
| `proxyConfiguration` | Apify proxy is recommended for larger runs. |

Example input:

```json
{
    "keywords": ["repair", "maintenance"],
    "department": "Water",
    "dueWithinDays": 14,
    "maxResults": 50
}
```

### Output

Every record has the same shape:

```json
{
    "id": "B2728456",
    "bidNumber": "B2728456",
    "title": "Automatic Door Repairs FY27",
    "department": "Free Library",
    "departmentCode": "52",
    "category": "Maintenance and Repair of Equipment",
    "dueDate": "2026-11-18T23:59:00",
    "status": "Sent",
    "organization": "City of Philadelphia",
    "buyer": "Purchaser MP",
    "contactEmail": null,
    "purchaseMethod": null,
    "typeCode": null,
    "location": null,
    "alternateId": null,
    "url": "https://www.phlcontracts.phila.gov/bso/external/bidDetail.sda?docId=B2728456&external=true&parentUrl=close",
    "scrapedAt": "2026-11-16T09:13:21.227Z"
}
```

| Field | Meaning |
|---|---|
| `id` | Stable key (the bid number), safe for deduplication between runs |
| `title` | Description of what the city wants to buy |
| `department` | Buying department, with its code in `departmentCode` |
| `category` | Commodity category the solicitation is filed under |
| `dueDate` | Bid opening date and time in Philadelphia local time, no time zone offset |
| `status` | Portal status. Open solicitations show as Sent |
| `buyer` | City purchaser handling the bid |
| `contactEmail`, `purchaseMethod`, `typeCode`, `location` | Filled only when `includeContactDetails` is on and the page loads |
| `url` | Link to the solicitation page on PHLContracts |

### Pricing

Pay per event: a small fee when a run starts, then a fixed price per result returned. You only pay for records that pass your filters. Set `maxResults` to cap any run.

### Limitations

- Only open solicitations are covered. Closed and awarded bids are not returned.
- Opening dates carry no time zone. The portal shows Eastern time.
- The city limits how fast solicitation pages can be opened. With `includeContactDetails` on, a run takes several minutes and some records come back without the extra fields. The default run does not open those pages.
- Documents attached to a solicitation and vendor quotes need a PHLContracts login and are not collected.

### FAQ

**Is this legal?** The Actor reads listings the site publishes for any visitor without a login and stores only business information published for that purpose. You are responsible for how you use the data.

**Something is missing or broken?** Open an issue in the Issues tab; response time is usually under a day.

# Actor input Schema

## `keywords` (type: `array`):

Keep solicitations whose title, bid number or buyer contains any of these words. Leave empty for all open solicitations.

## `department` (type: `string`):

Keep only solicitations from a department whose name contains this text, for example Streets, Water, Aviation or Free Library.

## `category` (type: `string`):

Keep only solicitations in a commodity category whose name contains this text, for example Construction, Food or Communication.

## `dueWithinDays` (type: `integer`):

Keep only solicitations whose opening date falls within this many days from now. Leave at 0 for no limit.

## `includeContactDetails` (type: `boolean`):

Open each solicitation page to add the buyer contact email, purchase method, type code and location. The city throttles these pages, so this is slower and some records may come back without them.

## `maxResults` (type: `integer`):

Hard stop for the run. You are billed per result, so this caps the cost.

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

Apify proxy is recommended for larger runs.

## Actor input object example

```json
{
  "keywords": [],
  "department": "",
  "category": "",
  "dueWithinDays": 0,
  "includeContactDetails": false,
  "maxResults": 200,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "keywords": [],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("talcoe/philadelphia-contracts").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 = {
    "keywords": [],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("talcoe/philadelphia-contracts").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 '{
  "keywords": [],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call talcoe/philadelphia-contracts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,talcoe/philadelphia-contracts"
        }
    }
}
```

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/gpciwhNWRoRDfaIQw/builds/acyM1WNKf0gL7U0ev/openapi.json
