Blog / API guides

Autotrader Scraper or API: What You Get

An Autotrader scraper loads search result pages for a postcode, then turns each car card's text (title, price, mileage, location) into fields you can store and compare. You maintain the fetching, the parsing and the clean-up of every value. The alternative is the AutoTrader UK endpoints, which return the same search as JSON at 1 credit per successful call: a recorded BMW search near SW1A 1AA came back with 42,916 results across 2,146 pages. This post compares the two routes field by field, prices a used-car watch in credits, and gives a verdict per job.

What does an Autotrader scraper have to do?

An Autotrader scraper has four jobs: build search URLs for a postcode and filters, fetch each results page, parse every car card into fields, and do it again on a schedule without losing track of which car is which. The fetch and the parse are the visible work. The upkeep is in the last two: knowing when a page layout changed and quietly emptied a column, and matching today's rows to yesterday's.

Car listings add their own parsing work. A results card mixes a make and model title, a trim line, a price string, a seller badge and a location with a distance in brackets. Each of those is a string you have to split, strip and convert, and each conversion is a place a small layout change breaks your data without raising an error.

Volume brings the usual problems for any large marketplace. A scraper that pulls thousands of pages a day should expect slow responses, challenge pages and blocked requests, and the right response to those is to slow down or stop, not to route around them. Read Autotrader's terms of use before you build a collector, and keep sellers' personal details out of anything you store.

What does one recorded search return?

One call to the search endpoint returns a page of listings and a pagination block that tells you how big the whole result set is. The recorded request asked for BMWs near SW1A 1AA, priced as a total rather than monthly, sorted by relevance:

curl "https://api.perceptlayer.com/v1/autotrader-uk/search?postcode=SW1A1AA&price_search_type=total&make=BMW&page=1&sort=relevance" \
  -H "X-API-Key: $API_KEY"

This is the recorded response, trimmed to the first listing and the pagination block:

{
  "success": true,
  "data": {
    "listings": [
      {
        "advert_id": "202610227244889",
        "type": "NATURAL_LISTING",
        "title": "BMW X5",
        "sub_title": "3.0d SE Exclusive Edition Auto 4WD Euro 4 5dr",
        "attention_grabber": "12 MONTHS MOT | EXTENSIVE HIST",
        "price": {
          "amount": 2700,
          "currency": "GBP",
          "display": "£2,700"
        },
        "vehicle_location": "Crawley (27 miles)",
        "distance": {
          "value": 27,
          "unit": "miles"
        },
        …
        "number_of_images": 16,
        "seller_type": "PRIVATE",
        "fpa_link": "/car-details/202610227244889?sort=relevance&searchId=07b3f6d8-f090-4951-ba5f-0a9b8fc1bfa6",
        …
        "position": 1,
        "tracking_context": {
          "price": 2700,
          "make": "BMW",
          "model": "X5",
          "year": 2005,
          "condition": "used",
          "price_indicator": "NOANALYSIS"
        }
      },
      …
    ],
    "pagination": {
      "page": 1,
      "page_count": 2146,
      "total_results": 42916,
      "has_more": true
    }
  },
  "meta": {
    "duration_ms": 1129,
    "endpoint_family": "search"
  }
}

The second recorded listing is a 2014 BMW 5 Series at price.amount 2200, 2 miles away in London, also a PRIVATE seller. Both rows carry the same searchId inside fpa_link, which is why that link is a poor key: it describes the search, not just the car.

Which fields would a scraper have to rebuild?

Most of the work a scraper's parser does is already done in the JSON, and the table below shows where. The left column is what you would read off a results card; the right column is the field the recorded search returns for it. Where the JSON keeps both a number and a display string, store the number and ignore the string.

On the page Scraper work Field in the recorded search
Car identity Pull an ID out of the link advert_id ("202610227244889")
"BMW X5" Read the title title, plus tracking_context.make and tracking_context.model
Trim and engine line Read the second line sub_title
"£2,700" Strip £ and commas, convert to int price.amount (2700), price.currency (GBP)
"Crawley (27 miles)" Split town from distance vehicle_location, distance.value, distance.unit
Year of the car Find it in the title or spec line tracking_context.year (2005)
Private or trade Read a badge seller_type (PRIVATE)
Photo count and URLs Collect image tags number_of_images, images[]
Seller's headline Read the banner text attention_grabber
Rank in results Count cards position

Two fields need care. The images[] URLs contain a literal {resize} segment, so test what you substitute there before you build on it. And both recorded rows have type: NATURAL_LISTING and price_indicator: NOANALYSIS; check what other values your own searches return before you filter on either.

Where do the other five endpoints fit?

The search result's advert_id has the same name as the required parameter on GET /v1/autotrader-uk/listing, so the names match; try a recorded advert_id in the playground to see the full listing before you depend on it. GET /v1/autotrader-uk/dealer takes a retailer_id, and GET /v1/autotrader-uk/dealer-listings takes a postcode and a retailer_id with the same filters as search. GET /v1/autotrader-uk/facets takes a postcode and a facets[] list (for example make, mileage, price or fuel_type), and GET /v1/autotrader-uk/taxonomy takes a postcode and an optional make. The AutoTrader UK API page lists every parameter.

How do a scraper and the endpoints compare?

The scraper costs engineering time and carries blocking and terms risk; the endpoints cost credits per page and leave you only the storage and the logic. For a recurring job, such as watching one make's prices within a distance of a postcode, the comparison looks like this.

DIY Autotrader scraper AutoTrader UK endpoints
Setup URL builder, fetcher, card parser, number clean-up, monitoring API key in the X-API-Key header
Filters Rebuild the site's query string yourself make, model, body_type, transmission, seller_type, fuel_type[], price, year and mileage ranges, distance
Prices Parse £ strings price.amount as an integer, price.currency
Identity across runs Extract an ID, hope the link format holds advert_id on every listing
Result size Count pages as you go pagination.total_results, page_count, has_more
When the layout changes Fields go empty until you fix the parser You read named JSON fields; no parser of yours to fix
Blocks and challenges Yours to handle 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 on paid packs
Cost Hosting and your time 1 credit per successful call

What does tracking a car cost per day?

Cost follows calls, and one search call returns a page of cars. The recording reports 42,916 results across 2,146 pages, which works out at about 20 listings a page (42,916 ÷ 2,146); check the count on your own calls, since page size isn't documented. Reading the whole BMW set once is 2,146 calls × 1 credit = 2,146 credits. At the free rate of 1 request a second that takes about 36 minutes; at 5 a second, about 7.

Most watches are narrower. Add model, max_price and a distance and the set shrinks; suppose it comes to 3,000 cars, or 150 pages. A daily run is then 150 calls × 1 credit = 150 credits, about 0.05 credits per car per day, and 4,500 credits over 30 days. That's more than the 100 free credits on signup and fits inside the Starter pack's 10,000. The credits docs explain how calls are debited, and pricing shows what credits cost.

How would you watch prices with the search endpoint?

A price watch needs three things: a loop over pages until has_more is false, a table keyed on advert_id, and a comparison with the last price you stored. The script below reads only fields from the recorded response and uses requests and the standard library's sqlite3.

import os
import sqlite3
import requests

API = "https://api.perceptlayer.com/v1/autotrader-uk/search"
HEADERS = {"X-API-Key": os.environ["API_KEY"]}
PARAMS = {"postcode": "SW1A1AA", "price_search_type": "total",
          "make": "BMW", "sort": "relevance"}

db = sqlite3.connect("autotrader.db")
db.execute("""CREATE TABLE IF NOT EXISTS cars (
  advert_id TEXT PRIMARY KEY, title TEXT, year INTEGER,
  price INTEGER, seller_type TEXT, distance INTEGER)""")

def run(max_pages=5):
    page = 1
    while page <= max_pages:
        r = requests.get(API, headers=HEADERS, params={**PARAMS, "page": page}, timeout=30)
        r.raise_for_status()
        data = r.json()["data"]
        for car in data["listings"]:
            new_price = car["price"]["amount"]
            row = db.execute("SELECT price FROM cars WHERE advert_id = ?",
                             (car["advert_id"],)).fetchone()
            if row and row[0] != new_price:
                print(car["advert_id"], car["title"], row[0], "->", new_price)
            db.execute("INSERT OR REPLACE INTO cars VALUES (?, ?, ?, ?, ?, ?)", (
                car["advert_id"], car["title"], car["tracking_context"]["year"],
                new_price, car["seller_type"], car["distance"]["value"]))
        db.commit()
        if not data["pagination"]["has_more"]:
            break
        page += 1

run()

max_pages caps the run at 5 credits while you test. Raise it once you've seen your own page counts, and read the X-Credits-Remaining header if you want the script to stop before the balance runs low. A 429 response carries Retry-After; the rate limits docs cover pacing a longer run.

Which route should you choose?

Choose by how often you need the data and how many cars you follow, since that decides whether parser upkeep or per-page credits dominate. For a handful of cars you'll check once, use the website in a browser and build nothing.

  • Daily price watch on one make or model near a postcode: use search with filters and store advert_id, price.amount and the run date, as in the script above. At about 20 cars a page that's roughly 0.05 credits per car per day.
  • One-off market snapshot (how many BMWs, at what prices, within a distance): one full pass, priced by page_count, for example 2,146 credits for the recorded search.
  • Following one dealer's stock: use dealer-listings with the dealer's retailer_id, and dealer for the dealer record.
  • Counts by make, mileage or price band without reading every listing: try facets with the facets[] values you need in the playground first.
  • A pricing model across several countries' marketplaces: start from the cars APIs, which list the other car sources that answer to the same key.
  • Learning to scrape: build against a practice site, not a live marketplace.
  • An agent answering used-car questions: add the MCP server so it calls search directly, as the AI agents docs describe.

For the same comparison on another listings site, Zillow Scraper or API covers property listings and eBay Scraper or API covers marketplace prices. To check the fields against your own postcode, run search in the playground on the AutoTrader UK API page, then get a free API key.

APIs in this post

Frequently asked questions

Is scraping Autotrader allowed?

That depends on Autotrader's terms of use and the law where you operate, so read the terms and take legal advice for commercial use. Don't get around blocks, challenges or other protections. Listing facts such as make, model, year and price carry less risk than personal data; leave private sellers' details out of anything you keep, and store only the fields your job needs.

How many results does one search call return?

The recorded BMW search returned total_results: 42916 across page_count: 2146, which is about 20 listings per page. Page size isn't documented, so read pagination on your own calls. Loop with page until has_more is false, and narrow a large set with model, price, year, mileage or distance filters.

Can I get monthly finance prices instead of cash prices?

Search, dealer listings and facets take price_search_type, which accepts total or monthly. The recorded call used total and returned price.amount in GBP. Run the same search with monthly in the playground to see what comes back before you store it, since only the total-price response is recorded here.

Does a failed Autotrader 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. Common codes are invalid_parameters (422) for a bad value and rate_limited (429), which carries a Retry-After header. The errors docs list every code.

How do I track the same car across runs?

Key your records on advert_id. It appears on every listing and is the required parameter of the listing endpoint. Don't key on fpa_link: in the recorded response it includes a searchId query value shared by every row of that search, so the link describes the search as well as the car.

  1. AutoTrader UK API: Get Used Car Listings as JSON

    Search UK used car listings by postcode, make and price with one GET call. Real BMW response, 6 endpoints, 1 credit per call, failed calls free.

  2. Cars.com API: Used Car Listings and Price Evaluations

    Search Cars.com listings with its six required parameters (zip, radius_miles, stock_type, sort, page, page_size), then listing, dealer and price-eval calls.

  3. AutoScout24 API: Search European Car Listings as JSON

    Search AutoScout24 listings as JSON: make_id and price filters, a recorded BMW response, and what a monthly price sweep costs in credits.

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.