What 402 actually means in scraping
The 402 code was originally reserved for "digital cash" payments that never materialized. Today it is a generic billing signal — most often "you ran out of credits." If your scraping pipeline calls a third-party API (Bright Data, Scrappey, an LLM, a CAPTCHA solver) and gets a 402, the upstream provider has decided your account can no longer pay for the work. The request body usually contains a human-readable message naming the quota or plan that lapsed.
How to detect and recover
Treat 402 as a hard fail, not a transient error. Backoff and retry will not help — the server is not overloaded; it is refusing on policy grounds. In production: alert immediately, pause the job, and route remaining work to a fallback provider if you have one. Log the response body so the on-call engineer can see exactly which quota tripped. Some providers degrade gracefully (rate-limit instead of 402) when you approach the limit; configure those warnings rather than waiting for the cliff.
When the target site returns 402
A small number of paywalled publishers return 402 instead of 401/403 to signal a metered article. Scrapers should respect this — bypassing a metered paywall to extract paid content is a clear terms-of-service breach. If you have legitimate access (institutional licence, paid subscription), authenticate via the proper login flow and reuse the session cookie rather than attempting to bypass the 402 directly.
