Parameters as Headers | cURL
Learn how to scrape websites using header-based parameters with ScraperAPI in cURL. Pass api_key, render, and instruction_set via headers to simplify requests.
Along with the “traditional” means of passing parameters, we also support passing parameters as headers. Passing parameters such as api_key
, render
, ultra_premium
and instruction_set
is very straightforward.
API REQUEST
Instead of including the parameters in the URL
curl https://api.scraperapi.com/?api_key=<API_KEY>&render=true&url=https://www.example.com
you can just pass them as headers
curl https://api.scraperapi.com -H “x-sapi-url: https://www.example.com” -H “x-sapi-api_key: <API_KEY>” -h “x-sapi-render: true”
PROXY MODE
curl -k --proxy “http://scraperapi:<API_KEY>@proxy-server.scraperapi.com:8001” https://www.example.com -H “x-sapi-render: true”
Note that credentials must still be passed to the proxy in the manner shown above, not as headers.
Last updated
Was this helpful?