On this page
What 403 means
HTTP 403 Forbidden says: the server knows what you want, but you may not have it. Unlike 401 Unauthorized, signing in would not necessarily help – the refusal is about who asks or how.
For scrapers, a 403 usually comes from the site's protection, not from the page itself. The same URL can answer 200 for one visitor and 403 for another.
The common causes
The request does not look like a browser: missing or unusual headers, no cookies, a library's default user agent. The address it comes from has asked too often before. The page only works after JavaScript has run and set cookies. The content is only for signed-in users or for certain countries.
Sometimes a 403 is simply the answer to too many requests – a 429 that the site never sent.
First: is the page meant to be public?
Before you change anything, check what the page is. Content behind a login, a paywall or a members' area is not public; scraping it without permission can break the site's terms and the law. Look for an official API, a feed or a data export – and at robots.txt and the terms.
If the page is public and you only need a modest amount of it, a 403 is a technical problem you can solve.
Fixes that respect the site
Send a complete, honest set of headers – accepted language, accepted formats and a user agent that names your client. Slow down and lower parallel requests. Load the page in a real browser when it needs JavaScript, so cookies are set as for any visitor. Keep a session, so cookies carry over from one page to the next.
What you should not do: crack logins, ignore an explicit no or hammer the site until it gives in.
With VirginProxy
Our API sends every request with complete, current browser headers. For pages that need JavaScript, "render" loads them in a real browser, and a session keeps cookies from one page to the next.
If the site still refuses, you get the 403 with its status and headers, so you can see what happened. Requests the site never answered cost nothing.
curl https://api.virginproxy.com/v1/requests \
-H "Authorization: Bearer $VP_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://shop.example/product/42", "render": true, "session": "shop-42"}'When a 403 means stop
If a site refuses consistently – also in a browser, at low speed and with complete headers – it does not want automated access. Respect that: ask the site for access, use its API, or get the data elsewhere. A clean data source is worth more than a scraper that breaks every week.
Last updated: