Skip to content

esimapp API docs

Free phone-checker APIs that need no key, and a keyed reseller API to sell esimapp plans from your own system.

Base URL
https://esimapp.io/api/v1
Rate limits
Phone checker: 60 searches and 300 lookups a minute per IP. Over a limit, the answer is 429 with Retry-After in seconds.
Terms
Free to use. Please link to esimapp.io where you show the answer.
Answers
JSON. The phone checker and reseller answers are wrapped with ok and data, or ok and error; the partner feed answers with its plain JSON. The phone checker can be called from any site's browser, and its answers are cached for five minutes.
Reseller API
Send Authorization: Bearer with a key from account settings, from your server only: it sends no CORS headers. Limits per key are 120 reads, 30 orders and 30 usage reads a minute, and 500 orders a day per account.

Getting started with the reseller API

You pay from a prepaid balance at the website price, and each order comes back with the eSIM for your customer. Six steps take you from nothing to a verified webhook.

  1. Turn on API access. In the API access section of Account settings, accept the API terms and choose Turn on API access. Open account settings
  2. Create a key. In the API access section of Account settings, choose Create key. It starts with esk_ and is shown once, so copy it then. An account can hold three active keys. Send it as Authorization: Bearer <key> from your server. Open account settings
  3. Fund your balance. Orders are paid from your wallet at the website price, with no discount. GET /balance shows what is left.
  4. Place an order. Send POST /orders with a plan slug from the catalogue and a new UUID as requestId. A created order answers 202. If a call times out, send the same requestId again: you get the same order and no second charge.
  5. Wait for the eSIM. Poll GET /orders/ followed by the order's ref until status is ready, or listen for the order.ready webhook. A ready order carries the activation code, and the order's qr.png endpoint draws it as a QR code.
  6. Check every webhook. Set a webhook URL in the API access section of Account settings. Each request carries Esimapp-Signature: t=<unix seconds>,v1=<hex>, the HMAC-SHA256 of the timestamp, a dot and the raw body under your webhook secret. Compare it in constant time and refuse a timestamp more than five minutes old. The sample below does this. Open account settings

Verify a webhook in Node

This server reads the raw body, checks the signature in constant time, refuses a timestamp more than five minutes old, and answers 200 only to a delivery that passes. Set ESIMAPP_WEBHOOK_SECRET to your webhook secret. The signature covers the raw body, so with Express put a raw-body parser such as express.raw on the webhook route, not a JSON one.

const http = require('node:http');
const crypto = require('node:crypto');

const SECRET = process.env.ESIMAPP_WEBHOOK_SECRET;
const TOLERANCE_SECONDS = 300;

function verify(rawBody, header, secret) {
  const fields = Object.fromEntries(String(header).split(',').map((part) => part.trim().split('=')));
  const sentAt = Number(fields.t);
  if (Number.isInteger(sentAt) === false) return false;
  if (Math.abs(Date.now() / 1000 - sentAt) > TOLERANCE_SECONDS) return false;
  const expected = crypto.createHmac('sha256', secret).update(sentAt + '.').update(rawBody).digest();
  const received = Buffer.from(String(fields.v1), 'hex');
  return received.length === expected.length && crypto.timingSafeEqual(received, expected);
}

http.createServer(async (req, res) => {
  const chunks = [];
  for await (const chunk of req) chunks.push(chunk);
  const rawBody = Buffer.concat(chunks);
  if (verify(rawBody, req.headers['esimapp-signature'], SECRET) === false) {
    res.writeHead(400).end();
    return;
  }
  // With Express, mount express.raw({ type: 'application/json' }) on this route so req.body is the raw Buffer.
  let event;
  try {
    event = JSON.parse(rawBody.toString('utf8'));
  } catch {
    res.writeHead(400).end();
    return;
  }
  console.log(event.event, event.order.ref);
  res.writeHead(200).end();
}).listen(3000);

Reseller endpoints

Every call needs your key. Successful answers are not cached, and the order endpoints only ever show your own orders.

  • GET /balance

    Your balance in cents, and whether it is frozen.

  • GET /catalog/destinations

    Every destination with plans, with how many plans it has and the price of the cheapest.

  • GET /catalog/destinations/{slug}

    One destination and its plans.

  • GET /catalog/plans/{slug}

    One plan: price, data, duration, networks and when its validity starts.

  • POST /orders

    Buy a plan from your balance. The body is plan, requestId and an optional reference. A repeat of the same requestId and plan returns the same order.

  • GET /orders

    Your orders, newest first. Filter by status or reference, 1 to 100 a page, with a cursor for the next page.

  • GET /orders/{ref}

    One order. The eSIM block appears only while the status is ready.

  • GET /orders/{ref}/qr.png

    The activation code as a PNG QR code, for a ready order.

  • GET /orders/{ref}/usage

    Data used on a ready order. The provider is read at most once a minute per order.

Webhooks

  • order.ready: the eSIM was delivered, and the order carries it.
  • order.failed: the order ended without delivery, and the money is back in your balance.
  • order.refunded: the order was refunded after delivery.

Each request is JSON with id, event, createdAt and order, the same order that the order endpoint returns. A retry repeats the id, so you can ignore a delivery you have already handled.

Answer with any 2xx within 10 seconds. Redirects are not followed, and the URL must be a public https address. A failed delivery is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours, then dropped after the seventh attempt. Events still queued when the webhook URL is changed or cleared, or when the account’s API access is switched off, are dropped, not sent.

Partner feed

A public JSON feed of every plan the website sells, for comparison sites. Prices are the website price in US dollars, the same for everyone, and the feed is in English. The answer holds generatedAt and a plans list.

GET https://esimapp.io/api/feeds/plans?ref=<code>

Replace <code> with the code you were given. Every plan link then carries it as ref, so a purchase made through the link is credited to you. An unknown or paused code answers 404. Leave ref out for the plain feed, which credits no one.

Answers are cached for one hour. Each IP can make 10 requests a minute; over that, the answer is 429.

Plan fields

id
The plan’s identifier. It does not change.
name
The plan’s name.
link
The plan’s page on esimapp.io, with your code as ref.
coverages
The countries the plan works in, each with its ISO alpha-2 code and the networks it uses there, each as a name and its types such as 4G or 5G. A network’s types never go beyond the plan’s speed. A country’s networks are left out when none are listed.
kind
country, regional or global.
dataCap
The data allowance in gigabytes, as a decimal such as 0.1 or 5, or 0 for an unlimited plan.
dataCapUnit
The unit of dataCap. Always GB.
dataBytes
The data allowance in bytes, or 0 for an unlimited plan.
validity
How many days the plan lasts.
prices
The price by currency, as an object with one key, USD, such as 8.45. It has at most two decimals.
speed
The plan’s speed as text, or null when none is stated.
maxSpeed
The plan’s speed limit in kbps, or null when it has none.
priceInfo
How the price is paid, the same on every plan: from an esimapp.io balance funded before buying, with the smallest top-up and what a card or crypto top-up adds.
internetBreakouts
The countries where the plan’s internet traffic exits, each as an object with an ISO alpha-2 code. Left out when the exit is not known.
additionalInfo
A note on what sets the plan apart from one that otherwise reads the same. Left out when there is none.

Example

One plan from the plans list, with the code esimdb.

{
  "id": "JP_5_30",
  "name": "Japan 5GB 30 days",
  "link": "https://esimapp.io/esim/japan?package=JP_5_30&ref=esimdb",
  "coverages": [
    {
      "code": "JP",
      "networks": [
        {
          "name": "SoftBank",
          "types": [
            "5G"
          ]
        },
        {
          "name": "KDDI",
          "types": [
            "5G"
          ]
        }
      ]
    }
  ],
  "kind": "country",
  "dataCap": 5,
  "dataCapUnit": "GB",
  "dataBytes": 5368709120,
  "validity": 30,
  "prices": {
    "USD": 8.45
  },
  "speed": "4G/5G",
  "maxSpeed": null,
  "priceInfo": "Paid from an esimapp.io account balance, so add funds before you buy. Top-ups start at $5.00. A card top-up adds a processing fee of $0.43 + 5.3% of the amount; a crypto top-up adds no fee from esimapp.io, though your wallet or exchange may charge a network fee."
}

Phone checker endpoints

Try it

Open an endpoint, choose Try it out, then Execute. Each call goes to the live API.