What 402 actually means in scraping
The 402 code was originally reserved for "digital cash" payments that never caught on. Today it is a general billing signal — usually meaning "you ran out of credits." If your scraping pipeline calls a paid third-party API (Bright Data, Scrappey, an LLM, a CAPTCHA solver) and gets a 402, that provider has decided your account can no longer pay for the work. The response body usually includes a plain-English message naming the quota or plan that ran out.
How to detect and recover
Treat 402 as a permanent failure, not a temporary glitch. Automatic backoff and retry (waiting, then trying again) will not help — the server isn't overloaded; it is refusing on purpose because of an account policy. In production: alert immediately, pause the job, and send the remaining work to a backup provider if you have one. Log the response body so the on-call engineer can see exactly which quota was hit. Some providers warn you nicely (slowing you down instead of returning 402) as you near the limit — switch those warnings on rather than waiting to hit the wall.
When the target site returns 402
A small number of paywalled publishers return 402 instead of 401 or 403 to signal a metered article (one you only get a limited number of for free). Scrapers should respect this — getting around a metered paywall to grab paid content is a clear terms-of-service breach. If you have legitimate access (an institutional licence or paid subscription), log in through the proper flow and reuse the session cookie — the token the site gives you after login to prove you're signed in — rather than trying to bypass the 402 directly.
