Blog / API guides

Craigslist Scraper or API: Watching New Postings

A Craigslist scraper fetches search pages for each area and category you care about, parses every posting's title, price, location and link, and compares the result with the last run to find what's new. You maintain the fetching, the parsing and the comparison. The alternative is four Craigslist endpoints that return the same postings as JSON at 1 credit per successful call, with an id and a bumped_at time on every result. On the recorded Portland bike search, a full sweep of 821 postings takes 3 calls, and this post compares that with a scraper and gives a verdict per job.

What does a Craigslist scraper's daily run involve?

A classifieds scraper does the same six things on every run, and each one is code you own. The steps below are general engineering for any classifieds site, not a description of Craigslist's own systems, but they're the parts that decide how much time the scraper takes after it's built.

  1. Build the search list. One search per area, category and keyword combination, with your price band. Ten cities and three categories is already 30 searches.
  2. Fetch result pages. Request each search and follow its pages until there are no more, at a pace that doesn't look like a flood.
  3. Parse each result. Find the title, price, area, image and link for every posting on the page, and turn the price text into a number.
  4. Deduplicate. Pull a stable ID out of each link and compare it with what you stored last time, so a reposted or refreshed ad doesn't count as new.
  5. Fetch details. Request each new posting's own page for the full text and attributes, which is one more request per posting.
  6. Check the run. Compare row counts and empty fields with yesterday's, because a parser that stops matching returns nothing rather than an error.

Steps 3 and 6 carry most of the upkeep. A page change moves the element your parser reads, the run returns fewer rows, and only the check in step 6 notices. Traffic at volume can also be slowed or blocked by any site this size; getting around that with proxy rotation or challenge solvers isn't something we'd recommend. Read Craigslist's terms of use before you build a collector.

What is the same job with the Craigslist endpoints?

The same job is three or four API calls: find the site and category codes once, search each combination, and fetch single postings where you need them. The Craigslist API has four endpoints, all GET and all 1 credit per successful call.

Endpoint Returns Parameters
/v1/craigslist/sites Sites country, query (both optional)
/v1/craigslist/categories Categories query (optional)
/v1/craigslist/search Search results site, subarea, category, query, min_price, max_price, sort, page (all optional)
/v1/craigslist/posting One posting id (required)

sort accepts date, dateoldest, rel, priceasc or pricedsc. Look up site and category values once in the playground with the sites and categories endpoints, then hard-code them in your search list; that's two calls in total, not two per run.

A real search: bikes in Portland

This is the recorded request: bikes in the portland site, category bia, priced between 50 and 300.

curl "https://api.perceptlayer.com/v1/craigslist/search?site=portland&category=bia&query=bike&min_price=50&max_price=300" \
  -H "X-API-Key: $API_KEY"

The recorded response, trimmed to the first two postings:

{
  "success": true,
  "data": {
    "total": 821,
    "page": 1,
    "per_page": 360,
    "has_more": true,
    "results": [
      {
        "position": 1,
        "id": "wnD16b4hEY7DaHprfGYGAg",
        "posting_id": 7988730852,
        "title": "21\" Specialized Sirrus A1 commuter",
        "url": "https://www.craigslist.org/view/wnD16b4hEY7DaHprfGYGAg",
        "price": 250,
        "currency": "USD",
        "images": [
          "https://images.craigslist.org/00s0s_f9B6cl8tXrr_0Cz0t2_600x450.jpg"
        ],
        "slug": "portland-21-specialized-sirrus-a1",
        "location": {
          "name": "multnomah county",
          "site": "portland",
          "subarea": "mlt",
          "latitude": 45.56,
          "longitude": -122.6001
        },
        "bumped_at": "2026-10-23T20:30:33Z"
      },
      {
        "position": 2,
        "id": "sZBbfWfnthmpp4JiN6rnJR",
        "posting_id": 7988729730,
        "title": "Gary Fisher Kaitai",
        …
        "price": 75,
        …
        "location": {
          "name": "Gresham",
          "site": "portland",
          "subarea": "mlt",
          …
        },
        "bumped_at": "2026-10-23T20:28:35Z"
      },
      …
    ]
  },
  "meta": {
    "endpoint_family": "search",
    "billable": true
  }
}

Every value a scraper would parse in step 3 is a named field. price is already a number, location carries coordinates and the subarea code, and location.site returns portland, the same value the request passed as site. The id in each result is also the last part of its url, and the posting endpoint's required parameter is named id too. Posting calls aren't in our recordings, so try one id on the posting endpoint page to see its fields before you build on them.

Which fields tell you a posting is new?

Two fields do the work of the scraper's deduplication step: id, a stable key for each posting, and bumped_at, a UTC timestamp. A posting whose id you haven't stored is new. A stored posting whose bumped_at has changed has been moved up again, which you'll usually want to record without counting it as a new item.

Order matters for polling. The recorded request passed no sort, and its first two results are in descending bumped_at order (20:30:33, then 20:28:35). For a poller, pass sort=date explicitly and confirm the order on your own search in the playground, so the newest postings land on page 1 and you rarely need page 2.

A poller with sqlite3

This Python script runs the Portland search, stores each posting by id and reports what's new and what was bumped since the last run. It uses only requests and the standard library, and reads only fields from the recorded response.

import os
import sqlite3

import requests

db = sqlite3.connect("postings.db")
db.execute(
    """CREATE TABLE IF NOT EXISTS postings (
        id TEXT PRIMARY KEY, posting_id INTEGER, title TEXT, price REAL,
        currency TEXT, subarea TEXT, url TEXT, bumped_at TEXT,
        first_seen TEXT DEFAULT CURRENT_TIMESTAMP)"""
)

resp = requests.get(
    "https://api.perceptlayer.com/v1/craigslist/search",
    params={"site": "portland", "category": "bia", "query": "bike",
            "min_price": 50, "max_price": 300, "sort": "date", "page": 1},
    headers={"X-API-Key": os.environ["API_KEY"]},
    timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]

new = bumped = 0
for r in data.get("results", []):
    seen = db.execute("SELECT bumped_at FROM postings WHERE id = ?", (r["id"],)).fetchone()
    if seen is None:
        new += 1
        db.execute(
            "INSERT INTO postings (id, posting_id, title, price, currency, subarea, url, bumped_at)"
            " VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
            (r["id"], r.get("posting_id"), r.get("title"), r.get("price"), r.get("currency"),
             (r.get("location") or {}).get("subarea"), r.get("url"), r.get("bumped_at")),
        )
    elif seen[0] != r.get("bumped_at"):
        bumped += 1
        db.execute("UPDATE postings SET bumped_at = ?, price = ? WHERE id = ?",
                   (r.get("bumped_at"), r.get("price"), r["id"]))
db.commit()

print(f"{new} new, {bumped} bumped; total {data.get('total')}, has_more {data.get('has_more')}")
print("credits used:", resp.headers.get("X-Credits-Used"))

Run it on a schedule and the first run fills the table; later runs report only the changes. API Pagination covers what to do when new postings arrive while you're paging.

How do a Craigslist scraper and the endpoints compare?

A scraper costs engineering time and puts blocking and terms risk on you; the endpoints cost 1 credit per successful call and remove the parsing and its upkeep. The comparison below is for a recurring job, such as watching a set of searches across several areas every hour.

DIY Craigslist scraper Craigslist endpoints
Setup URL builder, fetcher, result parser, dedupe store, run checks API key in the X-API-Key header
Areas and categories Kept as URL patterns in your code site, subarea and category parameters; lookups via sites and categories
Price Parsed from text price as a number with currency
Location Parsed area name, if shown location.name, site, subarea, latitude, longitude
New versus refreshed Your own ID extraction and comparison id and bumped_at on every result
Page depth Follow pages until none remain page and has_more; the recorded page held 360
When the page changes The parser stops matching, often silently Named JSON fields; there's no parser of yours to fix
Blocks and challenges Yours to handle at volume Not yours; a failed call returns an error code and costs 0
Speed As fast as you can fetch without being blocked 1 request a second free, at least 5 a second paid
Cost Hosting and your time 1 credit per successful call

What does watching a Craigslist search cost?

Cost follows calls, and the recorded search page held up to 360 postings, so per-posting costs are small and the schedule decides the bill. There are two numbers to work out: what a full sweep costs, and what polling for changes costs.

A full sweep of the Portland search is 821 postings ÷ 360 per page, rounded up, which is 3 pages. That's 3 calls × 1 credit = 3 credits, or 3 ÷ 821, about 0.004 credits per posting. Doing it once a day for 30 days is 90 credits.

Polling is where the volume is. Fetching page 1 of one search every hour is 24 calls × 1 credit = 24 credits a day, or 720 credits a month. The 100 free credits on signup cover the first four days of that, and a Starter pack of 10,000 credits covers a year of it. Ten searches polled hourly, for example one per city, is 240 credits a day, or 7,200 a month, which fits the Starter pack's 10,000. Polling every 15 minutes instead multiplies each figure by 4, so ten searches would come to 28,800 credits a month, inside the Build pack's 50,000. Add 1 credit for each posting you fetch in full with the posting endpoint. See pricing for what credits cost and the credits docs for how they're debited.

Which route should you choose?

Choose by how many searches you watch and how often, because that decides whether upkeep or per-call cost dominates. These verdicts assume a recurring job; for a look at today's listings in one city, open Craigslist in a browser and skip both.

  • Alerts for a specific item (a bike size, a model, a price band): poll page 1 of one search hourly with sort=date and alert on new id values. It's 720 credits a month.
  • Price benchmarking for used goods: run a full sweep daily and take the median of price per subarea. Remember these are asking prices.
  • Watching the same search in many cities: keep a list of site values, run one search per site and store location.site with each row.
  • Mapping supply: use location.latitude and location.longitude from search results, without fetching each posting.
  • Full posting text for a small set: fetch those postings with the posting endpoint, at 1 credit each.
  • Learning how scraping works: practise on a site built for it rather than a live classifieds site.
  • An agent that answers "what's for sale near me": give it the endpoints through the MCP server, as the AI agents docs describe.

Classifieds in other countries follow the same pattern: see Kleinanzeigen API and the marketplaces APIs. To check the fields on your own area, run search in the playground on the Craigslist API page, then get a free API key.

APIs in this post

Frequently asked questions

Is scraping Craigslist allowed?

That depends on Craigslist's terms of use, how you collect and use the data, and the law where you operate, so read the terms and get legal advice for commercial use. Don't get around blocks or other protections. Many postings are written by private individuals, so store item facts such as title, price and area, leave contact details out, and don't use collected postings to contact posters.

How many postings does one Craigslist search call return?

The recorded Portland bike search returned per_page: 360 with total: 821 and has_more: true. The page size isn't a parameter, so read per_page and has_more from each response and request the next page until has_more is false. Each successful page costs 1 credit, whatever it holds.

Poll as often as your use needs and your budget allows. Hourly polling of one search's first page is 720 credits a month; every 15 minutes is 2,880. Pass sort=date and check in the playground that the newest postings come first; then page 1 is usually all a poll needs. A free account allows 1 request a second, which is plenty for dozens of searches per poll.

Does a failed Craigslist call cost credits?

No. Only a successful response debits credits. A failed call returns an HTTP status and a JSON error with a code, a message and a request_id, plus X-Credits-Used: 0. A rate-limited call returns 429 with a Retry-After header giving the seconds to wait. The errors docs list every code.

Can I search several Craigslist cities at once?

One search call takes one site value, so run one call per city and merge the results, keyed by id. Each result's location.site tells you which city it came from. Ten cities polled hourly is 240 calls a day, and the rate limits docs list how fast each pack lets you send them.

  1. Craigslist API: Get Classified Postings as JSON

    Search Craigslist postings by site, category and price as JSON, then poll for new ones. A real response, the parameters and the credit cost.

  2. Etsy Scraper or API: What You Get

    An Etsy scraper vs one 10-credit product endpoint: a recorded listing with price, discount, quantity, variations and favorites, and the cost per item tracked.

  3. Vinted Scraper or API: What You Get

    A Vinted scraper vs 10 endpoints: one recorded search returned 24 items with price, service_fee and total_item_price for 1 credit, about 0.04 credits per item.

Start with 100 free credits

No password to set. We email you a sign-in link, and your key works on every API.

No credit card. 100 free credits on signup.