Skip to main content

Overview

Retrieve the list of countries and regions where Vellosim eSIM packages are available. This is typically the first step in your purchase flow to let users select their destination.

Quick Start

async function getRegions() {
  const response = await fetch('https://api.vellosim.com/api/esim/regions', {
    method: 'GET',
    headers: {
      'X-API-Key': `API_KEY}`,
      'Content-Type': 'application/json'
    }
  });
  
  const regions = await response.json();
  return regions;
}

// Usage
const regions = await getRegions();
console.log(`Found ${regions.length} available regions`);

Response Format

The API returns an array of region objects:
[
  {
    "code": "US",
    "name": "United States",
    "icon": "https://flagcdn.com/w320/us.png",
    "logo": "https://flagcdn.com/w320/us.png",
    "type": 1,
    "operatorList": [],
    "isActive": true,
    "createdAt": "2025-11-10T21:31:29.048Z",
    "updatedAt": "2025-11-10T21:31:29.048Z"
  },
  {
    "code": "GB",
    "name": "United Kingdom",
    "icon": "https://flagcdn.com/w320/gb.png",
    "logo": "https://flagcdn.com/w320/gb.png",
    "type": 1,
    "operatorList": [],
    "isActive": true,
    "createdAt": "2025-11-10T21:31:29.048Z",
    "updatedAt": "2025-11-10T21:31:29.048Z"
  }
]

Response Fields

FieldTypeDescription
codestringISO 3166-1 alpha-2 country/region code (e.g., “US”, “GB”)
namestringDisplay name for the region
iconstringURL to flag/icon image (320px width)
logostringURL to logo image
typenumberRegion type: 1 for countries, 2 for continents/multi-country
operatorListarrayList of network operators (if applicable)
isActivebooleanWhether the region is currently active
createdAtstringISO 8601 timestamp of creation
updatedAtstringISO 8601 timestamp of last update

Filtering by Type

Get Only Single Countries

async function getCountries() {
  const response = await fetch(
    'https://api.vellosim.com/api/esim/regions?type=1',
    {
      headers: {
        'X-API-Key': `API_KEY}`,
        'Content-Type': 'application/json'
      }
    }
  );
  
  const regions = await response.json();
  return regions;
}

Get Only Multi-Country Plans

async function getMultiCountryRegions() {
  const response = await fetch(
    'https://api.vellosim.com/api/esim/regions?type=2',
    {
      headers: {
        'X-API-Key': `API_KEY}`,
        'Content-Type': 'application/json'
      }
    }
  );
  
  const regions = await response.json();
  return regions;
}
Type Values:
  • type=1 returns single countries
  • type=2 returns continents/multi-country packages

Next Steps