Proxy Port Method
To simplify implementation for users with existing proxy pools, we offer a proxy front-end to the API. The proxy takes your requests, forwards them to ScraperAPI and handles proxy rotation, CAPTCHAs and retries automatically. It provides the same features and performance as the API endpoint.
The username for the proxy is scraperapi and the password is your API key.
curl --proxy 'http://scraperapi:[email protected]:8001' \
-k \
'https://www.example.com'import requests
#Replace the value for api_key with your actual API Key
proxies = {
"http": "http://scraperapi:[email protected]:8001"
}
r = requests.get('https://www.example.com', proxies=proxies, verify=False)
print(r.text)import axios from 'axios';
axios.get('https://www.example.com', {
method: 'GET',
proxy: {
host: 'proxy-server.scraperapi.com',
port: 8001,
auth: {
username: 'scraperapi',
//Replace the value for password with your actual API Key
password: 'API_KEY'
},
protocol: 'http'
}
})
.then(response => {
console.log(response)
})
.catch(error => {
console.log(error)
});Note: So that we can properly direct your requests through the API, your code must be configured to not verify SSL certificates.
To enable extra functionality whilst using the API in proxy mode, you can pass parameters to the API by adding them to the username, separated by dots. For example, if you want to enable Javascript Rendering to a request, the username would be scraperapi.render=true. You can add multiple parameters at a time.
curl --proxy 'http://scraperapi.render=true.country_code=us:[email protected]:8001' \
-k \
'https://www.example.com'import requests
#Replace the value for api_key with your actual API Key
proxies = {
"http": "http://scraperapi.render=true.country_code=us:[email protected]:8001"
}
r = requests.get('https://www.example.com', proxies=proxies, verify=False)
print(r.text)import axios from 'axios';
axios.get('https://www.example.com', {
method: 'GET',
proxy: {
host: 'proxy-server.scraperapi.com',
port: 8001,
auth: {
username: 'scraperapi.render=true.country_code=us',
//Replace the value for password with your actual API Key
password: 'API_KEY'
},
protocol: 'http'
}
})
.then(response => {
console.log(response)
})
.catch(error => {
console.log(error)
});Proxy Mode with SSL Verification
If you would like to send SSL verified requests to our Proxy API, you can manually trust our certificate by following these steps:
Download Our Proxy CA Certificate
Follow this link to download our proxy CA certificate.
Manually trust it on your device
Once you've downloaded the certificate, manually trust it in your scraping tool or library settings. This step may vary depending on the tool or library you're using, but typically involves importing the certificate into your trusted root store or by configuring SSL/TLS settings. Depending on your operating system, follow the instructions below to install the ScraperAPI CA Certificate.
Windows 10/11
Press the
Win key + Rhotkey and inputmmcin Run to open the Microsoft Management Console window.Click
Fileand selectAdd/Remove Snap-ins.In the opened window select
Certificatesand press theAdd >button.In the Certificates Snap-in window select
Computer account > Local Account, and press theFinishbutton to close the window.Press the
OKbutton in the Add or Remove Snap-in window.Back in the Microsoft Management Console window, select
Certificatesunder Console Root and right-clickTrusted Root Certification AuthoritiesFrom the context menu select
All Tasks > Importto open the Certificate Import Wizard window from which you can add the Scraper API certificate.
More details can be found here.
If you encounter any Certificate Revocation List (CRL) Distribution Points (DPs) related errors, please configure your SSL context to ignore certificate revocation checks.
macOS
Open Keychain Access window (
Launchpad > Other > Keychain Access).Select
Systemtab under Keychains, drag and drop the downloaded certificate file (or select File >Import Items...and navigate to the file).Enter the administrator password to modify the keychain.
Double-click the
ScraperAPI CAcertificate entry, expand Trust, next to When using this certificate: selectAlways Trust.Close the window and enter the administrator password again to update the settings.
Linux
Install the downloaded ScraperAPI proxyca.pem file:
Update stored Certificate Authority files:
If you have any questions or need further assistance regarding web scraping or certificate management, don't hesitate to reach out to the support team.
Last updated

