LogoLogo
OverviewRelease NotesDataPipelineFAQs
PHP
PHP
  • Make Requests with ScraperAPI in PHP
    • Use ScraperAPI Endpoint in PHP
    • Use ScraperAPI Proxy Port in PHP
    • Use ScraperAPI SDK in PHP
    • Make Async Requests with ScraperAPI in PHP
      • How to Use ScraperAPI Async Web Scraping in PHP
      • Use Async ScraperAPI Callbacks in PHP
      • Configure ScraperAPI Parameters in PHP
      • Request Async Batch Scraping with ScraperAPI in PHP
      • Decode Base64 Async Responses in PHP
    • ScraperAPI Structured Data Collection in PHP
      • Amazon Product Page API: Structured Data in PHP
      • Amazon Search API: Structured Data in PHP
      • Amazon Offers API: Structured Data in PHP
      • Amazon Reviews API: Structured Data in PHP
      • Ebay Product Page API: Structured Data in PHP
      • Ebay Search API: Structured Data in PHP
      • Google SERP API: Structured Data in PHP
      • Google News API: Structured Data in PHP
      • Google Jobs API: Structured Data in PHP
      • Google Shopping API: Structured Data in PHP
      • Google Maps Search API: Structured Data in PHP
      • Redfin Agent Details API: Structured Data in PHP
      • Redfin 'For Rent' Listings API: Structured Data in PHP
      • Redfin 'For Sale' Listings API: Structured Data in PHP
      • Redfin Listing Search API: Structured Data in PHP
      • Walmart Search API: Structured Data in PHP
      • Walmart Category API: Structured Data in PHP
      • Walmart Product API: Structured Data in PHP
      • Walmart Reviews API: Structured Data in PHP
    • ScraperAPI Async Structured Data Collection in PHP
      • Amazon Product Page API: Async Structured Data in PHP
      • Amazon Search API: Async Structured Data in PHP
      • Amazon Offers API: Async Structured Data in PHP
      • Amazon Reviews API: Async Structured Data in PHP
      • Ebay Product Page API: Async Structured Data in PHP
      • Ebay Search API: Async Structured Data in PHP
      • Google SERP API: Async Structured Data in PHP
      • Google News API: Async Structured Data in PHP
      • Google Jobs API: Async Structured Data in PHP
      • Google Shopping API: Async Structured Data in PHP
      • Google Maps Search API: Async Structured Data in PHP
      • Redfin Agent Details API: Async Structured Data in PHP
      • Redfin 'For Rent' Listings API: Async Structured Data in PHP
      • Redfin 'For Sale' Listings API: Async Structured Data in PHP
      • Redfin Listing Search API: Async Structured Data in PHP
      • Walmart Search API: Async Structured Data in PHP
      • Walmart Category API: Async Structured Data in PHP
      • Walmart Product API: Async Structured Data in PHP
      • Walmart Reviews API: Async Structured Data in PHP
    • Making POST/PUT Requests with ScraperAPI in PHP
    • Customizing ScraperAPI Requests in PHP
      • Customize Amazon Requests by ZIP Code via ScraperAPI in PHP
      • Customize Cached Results via ScraperAPI in PHP
      • Customize Control Costs with ScraperAPI Parameter in PHP
      • Send Custom Headers with ScraperAPI in PHP
      • Customize Device Type with ScraperAPI in PHP
      • Customize Geotargeted Content Scrape via ScraperAPI in PHP
      • Customize Premium Geotargeted Scrape via ScraperAPI in PHP
      • Customize Header Parameter with ScraperAPI in PHP
      • Customize Premium Residential/Mobile Proxies in PHP
      • Customize JavaScript-Rendered Pages via ScraperAPI in PHP
        • Use Render Instruction Set to Scrape Dynamic Pages in PHP
        • Customize Taking a Website Screenshots via ScraperAPI in PHP
      • Customize Scrape Session-Based Proxies via ScraperAPI in PHP
  • Handle and Process Responses via ScraperAPI in PHP
    • Use API Status Codes to Retry Failed Requests in PHP
    • Customize Output Formats via ScraperAPI Parameters in PHP
      • Request JSON Response via Autoparse Parameter in PHP
      • Request LLM Output Formats with ScraperAPI in PHP
    • Request Response Encoding and Content-Type via ScraperAPI in PHP
  • Dashboard & Billing
    • API Key
    • Credit Usage
    • Delete Account
    • Invoice History
    • Billing Email
    • Billing Address
    • VAT Number
    • Payment Method
    • Cancel Subscription
  • Credits and Requests
  • Monitor Your ScraperAPI Account Information in PHP
  • Documentation Overview
Powered by GitBook

Quick links

  • Homepage
  • Dashboard
  • Pricing
  • Contact Sales

Resources

  • Developer Guides
  • Blog
  • Contact Support
  • Learning Hub
On this page

Was this helpful?

  1. Make Requests with ScraperAPI in PHP
  2. Customizing ScraperAPI Requests in PHP

Customize Premium Geotargeted Scrape via ScraperAPI in PHP

Learn how to scrape premium location-specific content using ScraperAPI in PHP. Ideal for market research, pricing, and localization testing.

Last updated 9 months ago

Was this helpful?

In addition to the list of Country Codes listed on the 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

<?php

$url = "http://api.scraperapi.com?api_key=API_KEY&country_code=lu&premium=true&url=http://httpbin.org/ip";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    print_r($response);
}

curl_close($ch);
?>
  • PROXY MODE

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://httpbin.org/ip");
curl_setopt($ch, CURLOPT_PROXY, "http://scraperapi.country_code=lu.premium=true:API_KEY@proxy-server.scraperapi.com:8001");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
  • SDK METHOD

<?php
require 'vendor/autoload.php'; 

use ScraperAPI\Client; 

$apiKey = 'API_KEY';
$client = new Client($apiKey);

$response = $client->get("http://httpbin.org/ip", [
    "country_code" => "lu",
    "premium" => true
]);

print($response->raw_body);

Country Code
Country
Plans

ad

Andorra

Business Plan and higher.

af

Afghanistan

Business Plan and higher.

ag

Antigua and Barbuda

Business Plan and higher.

ai

Anguilla

Business Plan and higher.

al

Albania

Business Plan and higher.

am

Armenia

Business Plan and higher.

ao

Angola

Business Plan and higher.

as

American Samoa

Business Plan and higher.

aw

Aruba

Business Plan and higher.

ax

Åland Islands

Business Plan and higher.

az

Azerbaijan

Business Plan and higher.

ba

Bosnia and Herzegovina

Business Plan and higher.

bb

Barbados

Business Plan and higher.

bf

Burkina Faso

Business Plan and higher.

bh

Bahrain

Business Plan and higher.

bi

Burundi

Business Plan and higher.

bj

Benin

Business Plan and higher.

bl

Saint Barthélemy

Business Plan and higher.

bm

Bermuda

Business Plan and higher.

bn

Brunei

Business Plan and higher.

bo

Bolivia

Business Plan and higher.

bq

Bonaire, Sint Eustatius and Saba

Business Plan and higher.

bs

Bahamas

Business Plan and higher.

bt

Bhutan

Business Plan and higher.

bw

Botswana

Business Plan and higher.

by

Belarus

Business Plan and higher.

bz

Belize

Business Plan and higher.

cd

Democratic Republic of the Congo

Business Plan and higher.

cf

Central African Republic

Business Plan and higher.

cg

Republic of the Congo

Business Plan and higher.

ci

Côte d'Ivoire (Ivory Coast)

Business Plan and higher.

ck

Cook Islands

Business Plan and higher.

cm

Cameroon

Business Plan and higher.

cr

Costa Rica

Business Plan and higher.

cu

Cuba

Business Plan and higher.

cv

Cape Verde

Business Plan and higher.

cw

Curaçao

Business Plan and higher.

dj

Djibouti

Business Plan and higher.

dm

Dominica

Business Plan and higher.

do

Dominican Republic

Business Plan and higher.

dz

Algeria

Business Plan and higher.

er

Eritrea

Business Plan and higher.

et

Ethiopia

Business Plan and higher.

fj

Fiji

Business Plan and higher.

fk

Falkland Islands

Business Plan and higher.

fm

Micronesia

Business Plan and higher.

fo

Faroe Islands

Business Plan and higher.

ga

Gabon

Business Plan and higher.

gd

Grenada

Business Plan and higher.

ge

Georgia

Business Plan and higher.

gf

French Guiana

Business Plan and higher.

gg

Guernsey

Business Plan and higher.

gh

Ghana

Business Plan and higher.

gi

Gibraltar

Business Plan and higher.

gl

Greenland

Business Plan and higher.

gm

The Gambia

Business Plan and higher.

gn

Guinea

Business Plan and higher.

gp

Guadeloupe

Business Plan and higher.

gq

Equatorial Guinea

Business Plan and higher.

gt

Guatemala

Business Plan and higher.

gu

Guam

Business Plan and higher.

gw

Guinea-Bissau

Business Plan and higher.

gy

Guyana

Business Plan and higher.

hn

Honduras

Business Plan and higher.

ht

Haiti

Business Plan and higher.

im

Isle of Man

Business Plan and higher.

io

British Indian Ocean Territory

Business Plan and higher.

je

Jersey

Business Plan and higher.

jm

Jamaica

Business Plan and higher.

kg

Kyrgyzstan

Business Plan and higher.

kh

Cambodia

Business Plan and higher.

km

Comoros

Business Plan and higher.

kn

Saint Kitts and Nevis

Business Plan and higher.

kw

Kuwait

Business Plan and higher.

ky

Cayman Islands

Business Plan and higher.

kz

Kazakhstan

Business Plan and higher.

la

Laos

Business Plan and higher.

lc

Saint Lucia

Business Plan and higher.

lk

Sri Lanka

Business Plan and higher.

lr

Liberia

Business Plan and higher.

ls

Lesotho

Business Plan and higher.

lu

Luxembourg

Business Plan and higher.

ly

Libya

Business Plan and higher.

ma

Morocco

Business Plan and higher.

mc

Monaco

Business Plan and higher.

md

Moldova

Business Plan and higher.

me

Montenegro

Business Plan and higher.

mf

Saint Martin

Business Plan and higher.

mg

Madagascar

Business Plan and higher.

mh

Marshall Islands

Business Plan and higher.

mk

North Macedonia

Business Plan and higher.

ml

Mali

Business Plan and higher.

mm

Myanmar

Business Plan and higher.

mn

Mongolia

Business Plan and higher.

mo

Macau

Business Plan and higher.

mp

Northern Mariana Islands

Business Plan and higher.

mq

Martinique

Business Plan and higher.

mr

Mauritania

Business Plan and higher.

ms

Montserrat

Business Plan and higher.

mu

Mauritius

Business Plan and higher.

mv

Maldives

Business Plan and higher.

mw

Malawi

Business Plan and higher.

mz

Mozambique

Business Plan and higher.

na

Namibia

Business Plan and higher.

nc

New Caledonia

Business Plan and higher.

ne

Niger

Business Plan and higher.

ni

Nicaragua

Business Plan and higher.

np

Nepal

Business Plan and higher.

pf

French Polynesia

Business Plan and higher.

pg

Papua New Guinea

Business Plan and higher.

pm

Saint Pierre and Miquelon

Business Plan and higher.

pr

Puerto Rico

Business Plan and higher.

ps

Palestine

Business Plan and higher.

pw

Palau

Business Plan and higher.

py

Paraguay

Business Plan and higher.

qa

Qatar

Business Plan and higher.

re

Réunion

Business Plan and higher.

rw

Rwanda

Business Plan and higher.

sb

Solomon Islands

Business Plan and higher.

sc

Seychelles

Business Plan and higher.

sd

Sudan

Business Plan and higher.

sh

Saint Helena

Business Plan and higher.

sj

Svalbard and Jan Mayen

Business Plan and higher.

sl

Sierra Leone

Business Plan and higher.

sm

San Marino

Business Plan and higher.

sn

Senegal

Business Plan and higher.

so

Somalia

Business Plan and higher.

sr

Suriname

Business Plan and higher.

ss

South Sudan

Business Plan and higher.

st

São Tomé and Príncipe

Business Plan and higher.

sv

El Salvador

Business Plan and higher.

sx

Sint Maarten

Business Plan and higher.

sz

Eswatini

Business Plan and higher.

tc

Turks and Caicos Islands

Business Plan and higher.

td

Chad

Business Plan and higher.

tj

Tajikistan

Business Plan and higher.

tl

Timor-Leste

Business Plan and higher.

tm

Turkmenistan

Business Plan and higher.

tn

Tunisia

Business Plan and higher.

tv

Tuvalu

Business Plan and higher.

tz

Tanzania

Business Plan and higher.

ug

Uganda

Business Plan and higher.

uy

Uruguay

Business Plan and higher.

uz

Uzbekistan

Business Plan and higher.

va

Vatican City

Business Plan and higher.

vc

Saint Vincent and the Grenadines

Business Plan and higher.

vg

British Virgin Islands

Business Plan and higher.

vi

U.S. Virgin Islands

Business Plan and higher.

vu

Vanuatu

Business Plan and higher.

wf

Wallis and Futuna

Business Plan and higher.

ws

Samoa

Business Plan and higher.

ye

Yemen

Business Plan and higher.

yt

Mayotte

Business Plan and higher.

zm

Zambia

Business Plan and higher.

zw

Zimbabwe

Business Plan and higher.

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

Geotargeting
this