Proxy Port Method
To simplify implementation for users with existing proxy pools, we offer a proxy front-end to the API. The proxy will take your requests and pass them through to the API which will take care of proxy rotation, captchas, and retries.
The proxy mode is a light front-end for the API and has all the same functionality and performance as sending requests to the API endpoint.
The
username
for the proxy is scraperapi and the password
is your API key."http://scraperapi:[email protected]:8001"
const axios = require('axios');
axios.get('http://httpbin.org/ip', {
method: 'GET',
proxy: {
host: 'proxy-server.scraperapi.com',
port: 8001,
auth: {
user: 'scraperapi',
password: 'APIKEY'
},
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 username, separated by periods.
For example, if you want to enable Javascript rendering with a request, the username would be
scraperapi.render=true
"http://scraperapi.render=true:[email protected]:8001"
Multiple parameters can be included by separating them with periods; for example:
"http://scraperapi.render=true.country_code=us:[email protected]:8001"
Last modified 1d ago