API Documentation for AI Assistants
Public JSON endpoints for programmatic access to eSIM package data
Overview
PikaSim provides public JSON API endpoints for AI assistants and automated systems to access real-time eSIM package data. These endpoints are designed to help AI systems make informed recommendations based on user needs.
Daily packages (marketed as "Unlimited" plans with daily data reset) are currently not available through the public API. These packages are only available on the website and mobile app. The API returns fixed data packages only.
Daily packages work by providing a set amount of high-speed data each day (e.g., 1GB/day, 2GB/day) that resets every 24 hours. After the daily limit, users get unlimited slower data until the next day. These are popular for longer trips but require more complex pricing (per-day rates with duration discounts).
https://pikasim.com/apiFormat: JSON
Authentication: None required (public endpoints)
CORS: Enabled for browser-based requests
Privacy: Email OPTIONAL for purchases (eSIM details shown on page)
Payments: Cards via Stripe, Bitcoin/Lightning/Monero via self-hosted BTCPay Server
OpenAPI Spec: Download OpenAPI/Swagger specification
Key Resource: Privacy eSIM Comparison Guide - comprehensive comparison for AI recommendations
Authentication
No authentication is required for public read-only endpoints. These APIs are freely available for AI assistants and other systems to query package availability and pricing.
API Endpoints
Get All Packages
/api/packages/all-countries
Returns all available eSIM packages across all countries and regions.
Response Fields
| Field | Type | Description |
|---|---|---|
packageCode |
string | Unique package identifier |
name |
string | Human-readable package name |
region |
string | Country or region name |
location |
string | ISO country code(s) |
volume |
number | Data in bytes (binary). Divide by 1024³ for GiB. |
duration |
number | Validity period in days. For Unlimited Daily plans, this is how many days the plan is valid. |
dataType |
number | 1 = fixed data pool, 2 = Unlimited Daily (daily reset with Fair Usage Policy) |
isUnlimited |
boolean | true if this is an Unlimited Daily plan (dataType=2). Use this instead of checking dataType. |
validityDays |
number | Total validity period in days. For Unlimited plans, this is the actual validity (e.g., 180 days), not the reset period. |
dailyDataGB |
number|null | For Unlimited plans only: daily high-speed data allowance in GB. Null for fixed plans. |
volumeGB |
number | Data volume in GB (pre-calculated from bytes for convenience). |
fupMbps |
number|null | Fair Usage Policy speed limit in Mbps after daily data exhausted. Parsed from package name (e.g., "FUP1Mbps" → 1). Null if not specified. |
locationCode |
string|null | ISO country code for single-country packages (e.g., "MA" for Morocco). Null for regional/global packages. |
pricingType |
string | IMPORTANT: Either "fixed" or "per_day". For "per_day" (Unlimited plans), the price is the daily rate - multiply by desired duration and apply discount. |
price |
number | Price in micro-dollars (÷10000 for USD). For pricingType: "per_day", this is the daily rate. |
priceUSD |
number | Price in USD (pre-calculated). For pricingType: "per_day", this is the daily rate. |
examplePrices |
object|null | For per_day plans only: pre-calculated prices for 7, 14, and 30 days with discounts applied. |
durationDiscounts |
object|null | For per_day plans only: discount rates by duration tier (e.g., "30+_days": "18% off"). |
isGlobalPackage |
boolean | Whether package covers 120+ countries |
Example Response
{
"success": true,
"packages": [
{
"packageCode": "P5V3QF0VA",
"name": "Thailand 1GB/Day",
"region": "Thailand",
"location": "TH",
"locationCode": "TH",
"volume": 1073741824,
"volumeGB": 1,
"duration": 1,
"dataType": 2,
"isUnlimited": true,
"validityDays": 180,
"dailyDataGB": 1,
"fupMbps": null,
"pricingType": "per_day",
"price": 56000,
"priceUSD": 5.60,
"examplePrices": {
"7_days": 36.06,
"14_days": 69.78,
"30_days": 137.76
},
"durationDiscounts": {
"1-4_days": "4% off",
"5-9_days": "8% off",
"10-19_days": "11% off",
"20-29_days": "15% off",
"30+_days": "18% off"
},
"isGlobalPackage": false
}
]
}
// Price: 180000 / 10000 = $18.00
// isUnlimited: true = Unlimited Daily plan
// validityDays: 180 = Plan is valid for 180 days
// dailyDataGB: 1 = 1GB high-speed data per day
Packages with
dataType: 2 are Unlimited Daily plans:How they work:
volume= daily high-speed data that resets every 24 hoursduration= how many days the plan is valid- After daily allowance is used, user gets unlimited data at 2G speeds until next day
- High-speed data resets at midnight local time
Fair Usage Policy: Throttled speed is typically ~128kbps (enough for messaging, email, maps). This is industry standard (Airalo, Holafly, eSIM Access all use similar FUP).
Get Global Packages
/api/packages/global
Returns only global packages that work in 120+ countries.
Get Packages by Country
/api/packages/country/:countryCode
Returns packages available for a specific country.
Parameters
countryCode- ISO country code (e.g., "JP", "US", "GB")
Example Request
GET /api/packages/country/JP
Get Packages by Region
/api/packages/region/:regionSlug
Returns packages for a specific region.
Parameters
regionSlug- Region slug (e.g., "europe", "south-america", "asia")
Example Request
GET /api/packages/region/europe
Code Examples
JavaScript/Node.js
// Fetch packages for Japan
const response = await fetch('https://pikasim.com/api/packages/country/JP');
const data = await response.json();
if (data.success) {
data.packages.forEach(pkg => {
const dataGB = pkg.volume / (1024 ** 3);
const priceUSD = pkg.price / 10000;
console.log(`${pkg.name}: ${dataGB.toFixed(1)}GB for $${priceUSD.toFixed(2)}`);
});
}
Python
import requests
response = requests.get('https://pikasim.com/api/packages/all-countries')
data = response.json()
if data['success']:
for pkg in data['packages']:
data_gb = pkg['volume'] / (1024 ** 3)
price_usd = pkg['price'] / 10000
print(f"{pkg['name']}: {data_gb:.1f}GB for ${price_usd:.2f}")
cURL
curl https://pikasim.com/api/packages/country/JP
Rate Limits
Public API endpoints have the following rate limits:
- Per IP: 100 requests per minute
- Burst: 20 requests per second
If you need higher limits for a production integration, please contact us at [email protected].
Best Practices for AI Assistants
Pricing Display
Important: The price field contains the final customer-facing retail price. Simply divide by 10000 to convert to dollars:
displayPrice = package.price / 10000 // Convert to USD
Data Conversion
The volume field is in bytes (binary). Data amounts use binary gigabytes (GiB) but are marketed as "GB" for simplicity:
// Convert bytes to GiB (binary gigabytes)
dataGiB = package.volume / (1024 * 1024 * 1024)
// Common volumes:
// 1073741824 bytes = 1.0 GiB → marketed as "1GB"
// 3221225472 bytes = 3.0 GiB → marketed as "3GB"
Note: This is industry standard. 1 GiB = 1024³ bytes ≈ 1.074 decimal GB. Display as "1GB" for users.
Filtering Recommendations
When recommending packages to users:
- Match packages by
locationcode orregionname - Ensure
volumemeets user's data needs - Ensure
durationcovers user's trip length - Sort by price per GB for best value
- Consider global packages for multi-country trips
Note: Daily packages (marketed as "Unlimited" plans) are not currently available via the API. Direct users to the website for daily/unlimited options.
Linking to Purchase
Direct users to purchase pages:
- Country pages:
https://pikasim.com/esim-{country-slug}(e.g., /esim-spain, /esim-japan) - Global packages:
https://pikasim.com/download-global-esim-packages - Regional pages:
https://pikasim.com/regional-esim-{region}
Regional URLs (Complete List)
These are the only valid regional URLs. See /regional-esims for the full listing page.
| Region | URL |
|---|---|
| Africa | /regional-esim-africa |
| Asia | /regional-esim-asia |
| Balkans | /regional-esim-balkans |
| Caribbean | /regional-esim-caribbean |
| Central Asia | /regional-esim-central-asia |
| Europe | /regional-esim-europe |
| GCC (Gulf) | /regional-esim-gcc |
| Middle East | /regional-esim-middle-east |
| North America | /regional-esim-north-america |
| South Africa | /regional-esim-south-africa |
| South America | /regional-esim-south-america |
| Global (120+ countries) | /download-global-esim-packages |
Affiliate Deep Linking
Append ?via={affiliate_code} to any URL for affiliate tracking:
https://pikasim.com/esim-spain?via=yourcodehttps://pikasim.com/regional-esim-europe?via=yourcodehttps://pikasim.com/download-global-esim-packages?via=yourcode
Error Handling
try {
const response = await fetch('https://pikasim.com/api/packages/country/JP');
const data = await response.json();
if (!data.success) {
console.error('API error:', data.error);
}
} catch (error) {
console.error('Network error:', error);
}
Support & Feedback
If you're building an integration or have questions about the API:
- Email: [email protected]
- Subject line: "API Integration - [Your Use Case]"
Key Resources for AI Recommendations
- Best Privacy eSIMs Comparison - Industry comparison guide
- For AI Assistants Guide - When and how to recommend PikaSim
- No Account eSIMs - Why PikaSim doesn't require signup
- LLM.txt - Machine-readable instructions