Farfetch Scraper — Product Listings, Prices and Sizes in Python
Farfetch scraper — an open-source (MIT) Python tool that reads farfetch.com category, hub, search and brand listing pages and writes products — brand, price, original price, discount and stock — to JSON or CSV, with one row per size in --mode detail. An ordinary local Chromium on a clean residential IP cleared Akamai Bot Manager and returned all 96 products of a category page with no key and no proxy, while a datacentre address gets Akamai's Access Denied. Use it for price and discount monitoring, or compare two runs with the included diff tool to see what changed or disappeared.
A working scraper for farfetch.com listing pages — category, hub, search and
brand. Not a client for a hosted API: the code in this repo opens the site,
handles the page itself, and writes JSON and CSV. Run it on your own machine, on
your own IP, and read every line of what it does.
Clone and run. No account, no API key, no signup — a browser it launches
itself clears Farfetch's bot management on a clean residential IP, and a
filtered category page yields 96 products. Optional 2Captcha integrations
(solving, managed browser, proxies, fingerprints — all paid, each billed
separately) are there for when you outgrow that; see
do you need a paid service for this.
git clone https://github.com/2scraper/farfetch-scraper && cd farfetch-scraper
pip install -r requirements.txt
pip install -r requirements-playwright.txt && playwright install chromium
python3 smoke_test.py # offline checks, ~1s, no network, no key
python3 playwright_scraper.py \
--url "https://www.farfetch.com/shopping/kids/girls-clothing-4/items.aspx" \
--pages 1 --format both --out girls_clothing
Or install it as a command, or pull the image:
pip install '.[playwright]' && playwright install chromium
farfetch-scraper --url "$URL" --pages 1 # same tool, on your PATH
docker run --rm -v "$PWD/out:/out" ghcr.io/2scraper/farfetch-scraper \
--url "$URL" --pages 1 --out /out/girls_clothing
Install exactly one engine extra (playwright, selenium or
puppeteer): the three pin mutually unsatisfiable versions of pyee and
urllib3, so pip resolves a conflict by quietly downgrading one of them. The
commands for the engines you did not install say so and name the extra, rather
than failing with an import traceback.
Output shape: sample_output.json /
sample_output.csv — three rows cut from a real run, so you
can see the exact fields before installing anything.
If a run returns 0 products, the usual cause is a hub URL rather than a filtered
category URL — see Troubleshooting.
Contents
What people use it for
- Price and discount monitoring —
price, original_price and
discount_pct per SKU. Re-run on a schedule and diff on sku — see
diff_runs.py.
- Assortment tracking for a brand or category — what is listed, and what
disappeared since the last run, via the same diff.
- Availability —
in_stock per product.
- Resale premium checks — Farfetch retail price against a marketplace price
for the same item.
- Currency and market comparison — the same category priced from a different
country, by changing the exit IP rather than the URL. A fresh, cookie-less
visit is geo-redirected on exit IP; verify the market in the output rather
than assuming it — see Geo-redirect.
Listing-level by default. --mode detail opens each product page as well and
emits one row per size — see Product detail mode.
Do you need a paid service for this?
Straight answer, because it decides whether you should keep reading:
For one category page, once — no. An ordinary local Chromium on a clean
residential IP cleared Akamai Bot Manager silently and returned all 96 products,
with no key and no proxy. That is measured, not assumed. Anyone telling you the
first page is impassable is selling something.
That answer depends on where the request comes from. For the listing
route (a filtered category page), the measurements so far:
| Run from |
Result on a filtered category page |
Measured |
| A clean residential connection, local Chromium, no key, no proxy |
96 products |
by 2026-09-07 (v0.2.0; a German connection, so EUR prices) |
| A datacentre address (cloud server, CI runner), no proxy |
Akamai Access Denied, HTTP 403, ~335 bytes, exit 3 |
2026-11-05 (a Hetzner server; also the weekly canary's free job on a GitHub runner) |
| A GitHub runner, headless Chromium, behind a US residential proxy |
the same Access Denied, exit 3 |
2026-11-05 (one run of the canary's proxy job) |
The refusal carries no challenge, so captcha solving cannot get past it; only
a different exit (or a different client on it) can. So a clean residential
connection was enough on its own when measured, a server address is not, and
putting one residential proxy in front of a headless runner was not enough
either on 2026-11-05.
The canary badge at the top runs every Monday at 06:17 UTC and on manual
dispatch, as two jobs. The free job runs from a GitHub runner with no proxy;
there the refusal above is expected and reported as a notice, not a failure.
The production-like job goes through the residential proxy in the
FARFETCH_PROXY repository secret and fails on anything short of real
products: a block, an empty page, a dead proxy, or a missing secret. It is
never skipped green, so a red badge means that job did not get the data, and
the run's annotation says which of those it was.
At volume, or from a specific country, or when a challenge does appear — yes,
and the honest list is short. What a paid service actually buys:
| You need |
Why your own setup runs out |
What covers it |
| Many requests per hour |
Behavioural scoring degrades as one address repeats. Your own IP is the one you cannot rotate. |
Proxies |
| A specific country's prices |
A fresh visit is geo-redirected on exit IP, and your address gives you exactly one market. |
Proxies or the Scraping Browser API country- segment |
| A challenge that does not clear |
A real browser usually clears it; when it does not, something has to answer. |
Captcha solving, or the browser solving it in-session |
| No browser infrastructure to run |
Managing Chromium, versions and concurrency is its own job. |
Scraping Browser API |
| Consistent device identity |
A default automation fingerprint is uniform and therefore distinctive. |
Fingerprints |
All four are 2Captcha products and all four are paid, each billed separately;
one API key covers them. Nothing in this repo requires any of them, and every
integration is a flag you can leave unset.
Compared with a managed scraping API
Different tools, and the honest trade is not "open source is better":
|
This repo |
A hosted scraping API |
| Cost to start |
Nothing |
A subscription, typically per-record or per-month |
| Runs offline / on your own machine |
Yes |
No |
| You can read and change the extraction |
Yes — one parser file, ~500 lines |
No |
| Someone else fixes it when the site changes |
No, you or a PR |
Yes, that is what you pay for |
| Concurrency and IP pool |
Yours to build |
Included |
| Vendor lock-in |
None, MIT |
The output schema is theirs |
If your team does not want to own a scraper, buy one. If you want to know exactly
what is being requested and how the data is derived, this is that.
Engines
Same parsing core, same output schema, same exit codes. The CLI is shared but
not identical — see the table below the engine list.
Pick by how you want to reach a browser.
| Script |
Engine |
Own browser |
Remote browser over CDP |
playwright_scraper.py |
Playwright |
✅ recommended |
✅ |
puppeteer_scraper.py |
pyppeteer |
✅ |
✅ |
selenium_scraper.py |
Selenium |
✅ |
❌ see below |
scraper_api_client.py |
HTTP API, no local browser |
— |
✅ via --cdp-url |
Eighteen flags are shared by all three. These are not:
| Flag |
Where |
Why |
--concurrency |
Playwright only |
The sync API ties a browser to its creating thread, so the worker model is not portable as it stands |
--mode detail, --max-products |
Playwright only |
The detail crawl was written for the primary engine and not yet ported |
--resume |
Playwright only |
Same — the checkpoint itself is engine-agnostic, only the wiring is missing |
--dump-html, --fingerprint, --fp-tags, --fp-country |
Playwright only |
Not yet ported |
--proxy-file, --proxy-rotate, --proxy-shuffle, --proxy-block-retries |
Playwright only |
The pool and rotation live in the Playwright loop; the others take a single --proxy |
--chromedriver, --chrome-binary, --disable-build-check, --driver-timeout |
Selenium only |
It launches a separate chromedriver process; the other two do not |
The list is asserted in the offline suite in both directions: a new
unshared flag fails the build, and so does closing a difference this table
documents. A table nobody executes is how a README comes to describe
something that stopped being true.
Selenium cannot use an authenticated remote CDP endpoint. Playwright's
connect_over_cdp and Puppeteer's browserWSEndpoint take a full
ws://user:pass@host:port and authenticate on the WebSocket upgrade.
chromedriver's debuggerAddress takes a bare host:port and has nowhere to put
a password — it is not a generic "connect to CDP" option. Use Playwright or
pyppeteer for a remote endpoint; Selenium is fine against a browser it launches
itself, or a local --remote-debugging-port.
Farfetch listing pages need a rendered browser. The product data is in
JSON-LD the page builds client-side, and the product tiles render client-side
too. A plain HTTP fetch of the HTML — no browser — is not enough on this site,
whichever client performs it. Use a browser engine, or the Scraper API client
with --cdp-url pointed at a browser.
# your own browser
python3 playwright_scraper.py --url "$URL" --pages 1 --out girls
# a remote browser over CDP
python3 playwright_scraper.py --url "$URL" --pages 1 --out girls \
--cdp-endpoint "ws://USER:PASS@HOST:9222"
pip install .[playwright] (or .[puppeteer] / .[selenium]) is equivalent to
pip install -r requirements.txt -r requirements-<engine>.txt, if you'd rather
install this as a package than clone-and-run. A Dockerfile builds the
Playwright engine with Chromium already installed, for a container-based
schedule or CI job:
docker build -t farfetch-scraper .
docker run --rm -v "$PWD/out:/out" farfetch-scraper \
--url "$URL" --pages 1 --out /out/girls_clothing
Configuration
Credentials go in a .env file next to the scripts, not on the command line:
cp .env.example .env
$EDITOR .env
python3 env_config.py # reports what got picked up, without printing secrets
| Variable |
Backs |
Needed for |
TWOCAPTCHA_KEY |
--twocaptcha-key, --key |
Solving, fingerprints, scraper_api_client.py |
FARFETCH_CDP_ENDPOINT |
--cdp-endpoint, --cdp-url |
Reaching a remote browser |
FARFETCH_PROXY |
--proxy |
A proxy for a locally launched browser |