Skip to content

API reference

Services & countries

What you can buy numbers for, and where. Both lists change rarely; cache them for a few minutes.

Simulator inventory carries demo: true — fictional numbers, simulated SMS. The web app labels it wherever prices or stock are shown.

The Service object

An app or website you can receive verification codes from. The aggregates cover its enabled offers; only from_price is limited to offers in stock right now.

Attributes

  • idstring

    Unique identifier, prefixed svc_.

  • slugstring

    Stable identifier used everywhere else in the API, e.g. whatsapp.

  • namestring

    Display name.

  • categorystring

    Catalog category.

    One of:messagingsocialshoppingfoodtraveldatinggamingcollectiblesaiemailstreamingworkother

  • aliasesarray of string

    Other names the search understands (wa, tg…).

  • from_pricestring· nullable

    Cheapest in-stock price across countries in US dollars, as a decimal string.

  • from_price_microsinteger· nullable

    Cheapest in-stock price across countries in micro-dollars (1 USD = 1,000,000).

  • country_countinteger

    Countries with an enabled offer for this service, including offers that are out of stock right now. Get quotes shows stock per country.

  • avg_success_ratenumber· nullable

    Mean of the offers' expected success_rate, in stock or not, 0–1. An estimate, like the figure it averages.

    Between 0 and 1.

  • demoboolean

    true when every offer for this service is simulator (Demo inventory).

Service object · example
{
  "id": "svc_5Yb2NqL8wT3kV9mR1xCp",
  "slug": "whatsapp",
  "name": "WhatsApp",
  "category": "messaging",
  "aliases": [
    "wa",
    "whats app",
    "whatsapp business"
  ],
  "from_price": "0.205",
  "from_price_micros": 205000,
  "country_count": 30,
  "avg_success_rate": 0.85,
  "demo": true
}

The Country object

A country we sell numbers in.

Attributes

  • iso2string

    ISO 3166-1 alpha-2 country code.

  • namestring

    Country name in English.

  • dial_codestring

    International dialing prefix.

Country object · example
{
  "iso2": "US",
  "name": "United States",
  "dial_code": "+1"
}

List services

GET/v1/services

Lists enabled services, most popular first. With q, results are fuzzy-matched on name, slug and aliases (typos included) and sorted by match quality.

Query parameters

  • qstring· optional

    Search text, e.g. whatsap or tg.

  • categorystring· optional

    Only services in this category.

    One of:messagingsocialshoppingfoodtraveldatinggamingcollectiblesaiemailstreamingworkother

Returns

  • 200Matching services.

Errors

Any endpoint can also return unauthorized, account_disabled, rate_limited and internal_error, and method_not_allowed when called with another method.

curl -G https://passcode.sh/api/v1/services \
  -H "Authorization: Bearer $PASSCODE_API_KEY" \
  -d q=whatsapp
Response · 200
{
  "data": [
    {
      "id": "svc_5Yb2NqL8wT3kV9mR1xCp",
      "slug": "whatsapp",
      "name": "WhatsApp",
      "category": "messaging",
      "aliases": [
        "wa",
        "whats app",
        "whatsapp business"
      ],
      "from_price": "0.205",
      "from_price_micros": 205000,
      "country_count": 30,
      "avg_success_rate": 0.85,
      "demo": true
    }
  ]
}

List countries

GET/v1/countries

Lists every enabled country in display order. Use the iso2 code wherever a country parameter is accepted.

Returns

  • 200Countries.

Errors

Any endpoint can also return unauthorized, account_disabled, rate_limited and internal_error, and method_not_allowed when called with another method.

curl https://passcode.sh/api/v1/countries \
  -H "Authorization: Bearer $PASSCODE_API_KEY"
Response · 200
{
  "data": [
    {
      "iso2": "US",
      "name": "United States",
      "dial_code": "+1"
    },
    {
      "iso2": "GB",
      "name": "United Kingdom",
      "dial_code": "+44"
    }
  ]
}