API Documentation for AI Assistants - PikaSim - PikaSim

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

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 amount in bytes
duration number Validity period in days
price number Price in cents (multiply by 2 for display price)
isGlobalPackage boolean Whether package covers 120+ countries

Example Response

{
  "success": true,
  "packages": [
    {
      "packageCode": "JP-3GB-7D",
      "name": "Japan (3GB - 7 Days)",
      "region": "Japan",
      "location": "JP",
      "volume": 3221225472,
      "duration": 7,
      "price": 599,
      "isGlobalPackage": false
    },
    {
      "packageCode": "GL-5GB-30D",
      "name": "Global (120+ areas) (5GB - 30 Days)",
      "region": "Global (120+ areas)",
      "location": "GL",
      "volume": 5368709120,
      "duration": 30,
      "price": 1299,
      "isGlobalPackage": true
    }
  ]
}

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 / 100) * 2; // Display price (2x markup)

    console.log(`${pkg.name}: ${dataGB.toFixed(1)}GB for $${priceUSD.toFixed(2)}`);
  });
}

Python

import requests

# Fetch all packages
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'] / 100) * 2  # Display price (2x markup)

        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 our wholesale price in cents. When displaying prices to users, multiply by 2 to get the customer price:

displayPrice = (package.price / 100) * 2  // Convert cents to dollars and apply 2x markup

Data Conversion

The volume field is in bytes. Convert to GB for user-friendly display:

dataGB = package.volume / (1024 * 1024 * 1024)

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: (price * 2) / (volume / 1GB)
  • Consider global packages for multi-country trips

Linking to Purchase

Direct users to country-specific purchase pages:

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

Caching

Package data is updated periodically. We recommend:

  • Cache responses for up to 1 hour
  • Invalidate cache if a user reports incorrect pricing
  • Use ETag headers for conditional requests

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);
    // Fallback to global packages or return error to user
  }
} catch (error) {
  console.error('Network error:', error);
  // Handle network failures gracefully
}

Support & Feedback

If you're building an integration or have questions about the API:

We're happy to help AI assistants, travel platforms, and other services integrate with PikaSim!