Geotargeting (Premium)

In addition to the list of Country Codes listed on the Geotargeting page, our premium geotargeting service offers advanced capabilities for accessing and targeting exclusive geographic locations.

To get access to these geographic locations, please use premium=true together with the country_code parameter:

  • API REQUEST

import fetch from 'node-fetch';

fetch('https://api.scraperapi.com/?api_key=API_KEY&country_code=lu&premium=true&url=https://httpbin.org/ip')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
  • PROXY MODE

import axios from 'axios';

axios.get('http://httpbin.org/ip', {
  method: 'GET',
  proxy: {
    host: 'proxy-server.scraperapi.com',
    port: 8001,
    auth: {
      username: 'scraperapi.country_code=lu.premium=true',       
      password: 'API_KEY'  
    },
    protocol: 'http'
  }
})
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error(error);
  });
  • SDK Method

import scraperapiClient from 'scraperapi-sdk';

const client = scraperapiClient('API_KEY');

client.get('http://httpbin.org/ip', { country_code: 'lu', premium: true })
  .then(response => {
    console.log(response);
    const data = JSON.parse(response.body);
    console.log('IP Address:', data);
  })
  .catch(error => {
    console.error('Error:', error);
  });

ZIP Code Geo targeting is currently supported for the Amazon domain. To find out more, please visit this link.

Last updated