Netflix, YouTube, and Spotify price according to local markets. Why miss sales?
A simple query of the PPP API will adjust a product price based on visitor’s IP address or country of origin.
We simplify the process by bringing together data from trusted sources—purchasing power parity rates, IP address-to-country mapping, and currency exchange rates—saving you from querying multiple APIs and performing calculations.
{
"originalPrice": 50.00,
"originalCurrency": "USD",
"adjustedPrice": 15.85,
"adjustedCurrency": "USD",
"country": "Romania",
"discountPercentage": 58
}
PPPAPI is a straightforward API that accepts GET requests. The
amount (in USD) to be converted is a mandatory parameter.
Additionally, you can provide either the customer's IP address or their
country code in ISO-3166 format (2 or 3 characters). The API uses the
Purchasing Power Parity (PPP) algorithm to adjust the
amount based on the customer’s country of origin. It will return
the adjusted amount in USD, unless a currency conversion is requested.
Here you will find some sample code to get started, but feel free to
explore our full documentation for more details.
<?php
$ipAddress = "{IP-ADDRESS}";
$amount = "{AMOUNT}";
$url = "https://api.pppapi.com/v1/json?amount=$amount&ipAddress=$ipAddress";
$response = file_get_contents($url);
$data = json_decode($response, true);
print_r($data);
# Query using customer's ip address
curl https://api.pppapi.com/v1/json?amount=50&ipAddress=82.24.22.44
# Query using customer's country of origin
curl https://api.pppapi.com/v1/json?amount=50&countryCode=UAE
import requests
ip_address = "{IP-ADDRESS}"
amount = "{AMOUNT}"
url = f"https://api.pppapi.com/v1/json?amount={amount}&ipAddress={ip_address}"
response = requests.get(url)
data = response.json()
print(data)
Unlock unlimited, high-speed access to the PPP API with daily updates for currency rates, purchasing power parity data, and IP geolocation. Enjoy secure, unthrottled usage, prioritized support, and the ability to request new features—all backed by an API key.