headers parameter to send custom HTTP headers and cookies with your request. This is useful when the target website requires specific headers (like User-Agent, Referer, or Cookie) to return the expected content.
Use carefully with anti-bot protected sites - invalid or mismatched headers may cause blocks
If you override critical headers (e.g.
Accept-Encoding), it may impact response parsingWhen to Use
- Bypass geo or device-based content blocks by setting a
User-Agent - Simulate logged-in sessions using
Cookieheaders - Add custom
Authorizationheaders to access gated content - Force-language or locale-specific versions of a page (e.g.
Accept-Language: fr-FR)
Format
Theheaders parameter is a JSON object with header names and values.
Example Request
Notes
- All custom headers are passed as-is to the target page
- To send cookies, use the
Cookieheader — multiple cookies should be in standard format:"key=value; key2=value2"