To make it easier to get up and running you can also use our SDK. First, you will need to install the SDK:
npm install scraperapi-sdk --save
// remember to install the library: npm install scraperapi-sdk --save
const scraperapiClient = require('scraperapi-sdk')('APIKEY')
scraperapiClient.get('http://httpbin.org/ip')
.then(response => {
console.log(response)
})
.catch(error => {
console.log(error)
})
To enable extra functionality while using our SDK, simply add an additional parameter to the GET request:
// remember to install the library: npm install scraperapi-sdk --save
const scraperapiClient = require('scraperapi-sdk')('APIKEY')
scraperapiClient.get('http://httpbin.org/ip', {render: true})
.then(response => {
console.log(response)
})
.catch(error => {
console.log(error)
})
// remember to install the library: npm install scraperapi-sdk --save
const scraperapiClient = require('scraperapi-sdk')('APIKEY')
const params = {
render: true,
country_code: 'us'
}
scraperapiClient.get('http://httpbin.org/ip', params)
.then(response => {
console.log(response)
})
.catch(error => {
console.log(error)
})