Skip to main content
GET
/
api
/
esim
/
regions
[
  {
    "regionCode": "US",
    "regionName": "United States",
    "regionType": "LC",
    "countryCode": "US",
    "flagUrl": "https://flagcdn.com/w320/us.png",
    "packageCount": 15
  },
  {
    "regionCode": "GB",
    "regionName": "United Kingdom",
    "regionType": "LC",
    "countryCode": "GB",
    "flagUrl": "https://flagcdn.com/w320/gb.png",
    "packageCount": 12
  },
  {
    "regionCode": "EU",
    "regionName": "Europe",
    "regionType": "RG",
    "countryCode": null,
    "flagUrl": "https://example.com/flags/eu.png",
    "packageCount": 20
  },
  {
    "regionCode": "ASIA",
    "regionName": "Asia Pacific",
    "regionType": "RG",
    "countryCode": null,
    "flagUrl": "https://example.com/flags/asia.png",
    "packageCount": 18
  },
  {
    "regionCode": "GLOBAL",
    "regionName": "Global Coverage",
    "regionType": "GL",
    "countryCode": null,
    "flagUrl": "https://example.com/flags/global.png",
    "packageCount": 8
  }
]

Endpoint

GET /api/esim/regions

Description

This endpoint returns a list of all available regions where eSIM packages can be purchased. Regions can be individual countries or multi-country/continental packages.

Authentication

X-API-Key
string
required
API Key for authentication
YOUR_API_KEY

Query Parameters

type
number
Filter by region type:
  • 1 - Countries only (single country packages)
  • 2 - Continents/Multi-country packages only
If omitted, returns all regions.

Response

regions
array
Array of region objects

Example Request

curl -X GET 'https://api.vellosim.com/api/esim/regions?type=1' \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Example Response

[
  {
    "regionCode": "US",
    "regionName": "United States",
    "regionType": "LC",
    "countryCode": "US",
    "flagUrl": "https://flagcdn.com/w320/us.png",
    "packageCount": 15
  },
  {
    "regionCode": "GB",
    "regionName": "United Kingdom",
    "regionType": "LC",
    "countryCode": "GB",
    "flagUrl": "https://flagcdn.com/w320/gb.png",
    "packageCount": 12
  },
  {
    "regionCode": "EU",
    "regionName": "Europe",
    "regionType": "RG",
    "countryCode": null,
    "flagUrl": "https://example.com/flags/eu.png",
    "packageCount": 20
  },
  {
    "regionCode": "ASIA",
    "regionName": "Asia Pacific",
    "regionType": "RG",
    "countryCode": null,
    "flagUrl": "https://example.com/flags/asia.png",
    "packageCount": 18
  },
  {
    "regionCode": "GLOBAL",
    "regionName": "Global Coverage",
    "regionType": "GL",
    "countryCode": null,
    "flagUrl": "https://example.com/flags/global.png",
    "packageCount": 8
  }
]

Region Types

TypeCodeDescriptionExample
LocalLCSingle country coverageUnited States, Japan, France
RegionalRGMultiple countries in a regionEurope, Asia Pacific, Caribbean
GlobalGLWorldwide coverageGlobal eSIM packages

Use Cases

Use this endpoint to populate a country/region selector in your UI:
async function loadRegions() {
  const regions = await fetch('/api/esim/regions?type=1', {
    headers: { 'X-API-Key': ' YOUR_API_KEY' }
  }).then(r => r.json());
  
  const selector = document.getElementById('country-select');
  regions.forEach(region => {
    const option = document.createElement('option');
    option.value = region.regionCode;
    option.text = region.regionName;
    selector.appendChild(option);
  });
}
Display which regions have available packages:
const regions = await getRegions();
const availableRegions = regions.filter(r => r.packageCount > 0);

console.log(`${availableRegions.length} regions have available packages`);
Create different sections for single-country and multi-country packages:
const countries = await fetch('/api/esim/regions?type=1', {
  headers: { 'X-API-Key': ' YOUR_API_KEY' }
}).then(r => r.json());

const multiCountry = await fetch('/api/esim/regions?type=2', {
  headers: { 'X-API-Key': ' YOUR_API_KEY' }
}).then(r => r.json());

displayCountries(countries);
displayRegionalPackages(multiCountry);

Next Steps