# Craigslist Scraper (`gio21/craigslist-scraper`) Actor

Scrape Craigslist classifieds across any US/CA/world city. For sale, jobs, housing, gigs, services, community, events. Multi-city + multi-category. Uses Craigslist API for fast extraction with price, GPS, images, URLs. $0.005/listing.

- **URL**: https://apify.com/gio21/craigslist-scraper.md
- **Developed by:** [Gio](https://apify.com/gio21) (community)
- **Categories:** Lead generation, E-commerce
- **Stats:** 4 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$5.00 / 1,000 listing scrapeds

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Craigslist Scraper

Scrape Craigslist classified ads across **any city, any category**, fast.

Uses Craigslist's own public API (`sapi.craigslist.org`), the same endpoint the site loads from in your browser. No browser, no proxy required, no Cloudflare in the way. Typical run: **360 listings in ~2 seconds**.

> Cheaper and friendlier than the alternative: **$0.005 / listing** (vs $0.008 elsewhere = 37% less). No URL gymnastics — just pass a city slug and a category code.

### What it extracts

| Field | Description |
|---|---|
| `postingId` | Craigslist posting ID |
| `title` | Listing title |
| `price` | Formatted price (e.g. `"$60"`) |
| `priceNumeric` | Price as integer (USD) |
| `city` | City slug from input |
| `category` | Category code (e.g. `sss`) |
| `categoryLabel` | Human-readable category |
| `subareaCode` | City subarea (e.g. `que`, `mnh`, `lgi`) |
| `location` | Neighborhood / location description |
| `latitude`, `longitude` | GPS coordinates |
| `images` | Image URLs (600x450) |
| `imageCount` | Number of images |
| `slug` | URL slug |
| `url` | Direct link to the posting |
| `datePosted` | ISO timestamp of when the post was created |
| `anonymousPosterId` | Craigslist anonymous poster ID |
| `scrapedAt` | When this row was scraped |

### How to use

#### Input

| Field | Required | Description |
|---|---|---|
| `cities` | yes | Array of city slugs. Examples: `newyork`, `losangeles`, `sfbay`, `chicago`, `washingtondc`, `seattle`, `austin`, `denver`, `miami`, `boston`, `toronto`, `london`, `sydney`. See the full list at https://www.craigslist.org/about/sites. |
| `categories` | yes | Array of category codes (see below). |
| `searchTerm` | no | Free-text keyword filter (e.g. `iphone`, `software engineer`, `studio apartment`). |
| `minPrice` | no | Minimum price (USD). |
| `maxPrice` | no | Maximum price (USD). |
| `hasImage` | no | If true, only return listings with images. |
| `postedToday` | no | If true, only return listings from the last 24 hours. |
| `maxItems` | no | Total listings cap across all combinations (default 100). |

#### Common category codes

| Code | Category |
|---|---|
| `sss` | For sale (everything) |
| `cta` | Cars + trucks |
| `apa` | Apts/housing for rent |
| `hhh` | Housing (all) |
| `jjj` | Jobs (all) |
| `ggg` | Gigs |
| `ppp` | Services |
| `bbb` | Community |
| `vvv` | Events |
| `rrr` | Resumes |

#### Example: iPhones for sale in NY + LA

```json
{
  "cities": ["newyork", "losangeles"],
  "categories": ["sss"],
  "searchTerm": "iphone",
  "maxItems": 200
}
```

#### Example: apartments for rent under $3000 in San Francisco

```json
{
  "cities": ["sfbay"],
  "categories": ["apa"],
  "maxPrice": 3000,
  "hasImage": true,
  "maxItems": 100
}
```

#### Example: software engineer jobs in 5 cities

```json
{
  "cities": ["newyork", "sfbay", "seattle", "austin", "boston"],
  "categories": ["jjj"],
  "searchTerm": "software engineer",
  "maxItems": 500
}
```

### Pricing

**$0.005 per listing** (pay-per-event). No platform usage cost.

| Volume | Cost |
|---|---|
| 100 listings | $0.50 |
| 1,000 listings | $5.00 |
| 10,000 listings | $50.00 |

Free Apify plan: limited to 25 listings per run.

### Why this scraper

| Feature | This scraper | ivanvs/craigslist-scraper-pay-per-result |
|---|---|---|
| Price per listing | **$0.005** | $0.008 |
| Input | City + category + filters | Pre-built URL only |
| Multi-city/multi-category | ✅ in one run | One URL per run |
| Speed | ~2s per 360 listings | Slower (HTML parsing) |
| GPS coordinates | ✅ | Not extracted |
| Multi-resolution images | ✅ 600×450 + originals | Single thumbnail |
| Date/time of post | ✅ ISO timestamp | Often missing |

### How it works

- Calls `https://sapi.craigslist.org/web/v8/postings/search/full?searchPath={cat}&...` — the same API Craigslist uses internally.
- First request returns 360 items; subsequent batches return 1080 each.
- Each item is a compact tagged array — we decode `postingId`, GPS, prices, images, slug, and a few more fields via the same lookup table the website JS uses.
- got-scraping handles TLS fingerprinting so Cloudflare on the API edge stays happy.
- Charges `listing-scraped` once per pushed listing.

# Actor input Schema

## `cities` (type: `array`):

Craigslist city slug(s) — the subdomain part. Examples: `newyork`, `losangeles`, `sfbay`, `chicago`, `washingtondc`, `seattle`, `boston`, `miami`, `austin`, `denver`, `toronto`, `vancouver`, `london`, `sydney`. Find yours at https://www.craigslist.org/about/sites.

## `categories` (type: `array`):

Craigslist category codes. Common: `sss` = for-sale (all), `cta` = cars+trucks, `jjj` = jobs, `hhh` = housing, `apa` = apts/housing for rent, `ggg` = gigs, `ppp` = services, `bbb` = community, `vvv` = events, `rrr` = resumes.

## `searchTerm` (type: `string`):

Free-text query to filter results (e.g. `iphone`, `studio apartment`, `software engineer`). Leave empty to scrape everything in the chosen category.

## `minPrice` (type: `integer`):

Filter listings by minimum price (USD). Only applies to categories that have prices.

## `maxPrice` (type: `integer`):

Filter listings by maximum price (USD). Only applies to categories that have prices.

## `hasImage` (type: `boolean`):

If true, only return listings that have at least one image.

## `postedToday` (type: `boolean`):

If true, only return listings posted in the last 24 hours.

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

Maximum total listings to scrape across all (city × category) combinations.

## Actor input object example

```json
{
  "cities": [
    "newyork"
  ],
  "categories": [
    "sss"
  ],
  "hasImage": false,
  "postedToday": false,
  "maxItems": 50
}
```

# Actor output Schema

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

Scraped Craigslist listings.

# 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 = {
    "cities": [
        "newyork"
    ],
    "categories": [
        "sss"
    ],
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("gio21/craigslist-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 = {
    "cities": ["newyork"],
    "categories": ["sss"],
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("gio21/craigslist-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 '{
  "cities": [
    "newyork"
  ],
  "categories": [
    "sss"
  ],
  "maxItems": 50
}' |
apify call gio21/craigslist-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gio21/craigslist-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/PMw1jqWuaq8wUVNs0/builds/X2KryEzF8O7HcmVaY/openapi.json
