Sending Custom Headers
curl --request GET \
--header "X-MyHeader: 123" \
--url 'http://api.scraperapi.com/?api_key=API_KEY&keep_headers=true&url=http://example.com' import requests
target_url = 'https://example.com'
# Replace the value for api_key with your actual API Key.
api_key = 'API_KEY'
headers = {
'X-MyHeader': '123'
}
request_url = (
f'http://api.scraperapi.com?'
f'api_key={api_key}'
f'&url={target_url}'
f'&keep_headers=true'
)
response = requests.get(request_url, headers=headers)
print(response.text)curl --request GET \
--header "X-MyHeader: 123" \
--proxy "http://scraperapi.keep_headers=true:[email protected]:8001" \
--insecure \
"http://example.com"import requests
target_url = 'https://example.com'
# Replace the value for api_key with your actual API Key.
api_key = 'API_KEY'
headers = {
'X-MyHeader': '123'
}
proxies = {
'http': f'http://scraperapi.keep_headers=true:{api_key}@proxy-server.scraperapi.com:8001'
}
response = requests.get(
target_url,
headers=headers,
proxies=proxies,
verify=False
)
print(response.text)Last updated

