Skip to main content

Add HTTP headers to request

You can add your custom headers to a request. To do so, pass them as JSON in headersparameter. Remember to encode this parameter like in the example below.

Example

In the example below we add two headers:

  • Accept-Language: en-US,en;q=0.9,en;q=0.8,
  • X-Custom-Header: value.

These headers will be forwared to the requested page.

curl -G \
--data-urlencode 'url=https://example.com' \
--data-urlencode 'headers={"accept-language": "en-US,en;q=0.9,en;q=0.8", "x-custom-header": "value"}' \
'https://scraping.narf.ai/api/v1/?api_key=[your api key]'