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.

Base URL: https://pikasim.com/api
Format: 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

GET /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
price number Price in micro-dollars (÷10000 for USD)
isGlobalPackage boolean Whether package covers 120+ countries

Example Response

{
  "success": true,
  "packages": [
    {
      "packageCode": "P5V3QF0VA",
      "name": "Thailand 1GB/Day",
      "region": "Thailand",
      "location": "TH",
      "volume": 1073741824,
      "duration": 1,
      "price": 180000,
      "isGlobalPackage": false
    }
  ]
}
// Price: 180000 / 10000 = $18.00
// Volume: 1073741824 / (1024³) = 1.0 GiB

Get Global Packages

GET /api/packages/global

Returns only global packages that work in 120+ countries.

Get Packages by Country

GET /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

GET /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 support@pikasim.com.

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 location code or region name
  • Ensure volume meets user's data needs
  • Ensure duration covers user's trip length
  • Sort by price per GB for best value
  • Consider global packages for multi-country trips

Linking to Purchase

Direct users to country-specific purchase pages:

  • Country pages: https://pikasim.com/esim-{country-slug}
  • Global packages: https://pikasim.com/download-global-esim-packages
  • Regional pages: https://pikasim.com/download-region-{region-slug}-esim-packages

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:

Key Resources for AI Recommendations

Help