Custom Headers

BrowserAPI allows you to add your own headers to a request and get customised results.

Custom HTTP headers are useful when you want to provide additional information to your request. If your request requires passing custom HTTP headers, all you have to do is to append WSA- to your header's name and add them to your request.

For example, the Sec-Fetch-Dest: document header will be passed as WSA-Sec-Fetch-Dest: document.

Only the following headers can be overwritten:

  • accept

  • accept-encoding

  • accept-language

  • cache-control

  • connection

  • content-type

  • dnt

  • origin

  • referer

  • save-data

  • sec-ch-ua

  • sec-ch-ua-mobile

  • sec-ch-ua-platform

  • sec-fetch-dest

  • sec-fetch-mode

  • sec-fetch-site

  • sec-fetch-user

  • sentry-trace

  • upgrade-insecure-requests

  • user-agent x-amzn-trace-id

  • x-forwarded-port

  • x-i18n-language

  • x-lpm-session

  • x-requested-with

  • x-unique-id

Additional headers may be added per domain by contacting our support.

Custom Headers Integration Examples

curl --request GET --url "https://api.webscrapingapi.com/v1?api_key=<YOUR_API_KEY>&url=http%3A%2F%2Fhttpbin.org%2Fheaders" --header "wsa-x-unique-id: unique"
Response Example
<html><head><meta name="color-scheme" content="light dark"><meta charset="utf-8"></head><body><pre>{
  "headers": {
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", 
    "Accept-Encoding": "gzip, deflate, br, zstd", 
    "Accept-Language": "en-US,en;q=0.9", 
    "Host": "httpbin.org", 
    "Priority": "u=0, i", 
    "Sec-Ch-Ua": "\"Chromium\";v=\"116\", \"Not)A;Brand\";v=\"24\", \"Google Chrome\";v=\"116\"", 
    "Sec-Ch-Ua-Mobile": "?1", 
    "Sec-Ch-Ua-Platform": "\"Windows\"", 
    "Sec-Fetch-Dest": "document", 
    "Sec-Fetch-Mode": "navigate", 
    "Sec-Fetch-Site": "none", 
    "Sec-Fetch-User": "?1", 
    "Upgrade-Insecure-Requests": "1", 
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36", 
    "X-Amzn-Trace-Id": "Root=1-6720a91f-6e5946dc225348484fc64090", 
    "X-Unique-Id": "unique"
  }
}
</pre><div class="json-formatter-container"></div></body></html>

Last updated