WebScrapingAPI 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 use this feature to get customized results, do not use this feature to avoid blocks. WebScrapingAPI has a powerful internal engine that takes care of everything for you.
var client = new RestClient("https://api.webscrapingapi.com/v1?api_key=%7B%7Bapi_key%7D%7D&url=http%3A%2F%2Fhttpbin.org%2Fheaders");
var request = new RestRequest(Method.GET);
request.AddHeader("Wsa-My-header", "test");
request.AddHeader("Wsa-User-Agent", "potato");
IRestResponse response = client.Execute(request);
By default, when you add custom headers to your request, WebScrapingAPI will pass the original headers alongside the ones you specified. If you do not wish to pass the original headers to your request, you will have to disable this feature by passing the keep_headers=0 parameter.
We've kept the example above and just added the keep_headers=0 parameter to the request and here is how the response differs from the original one: