โšก Telegram numbers API

Virtual numbers for Telegram โ€” in your bot, automatically

Buy ready Telegram numbers and receive the login code through a simple HTTP API. 211 countries, prices in USD, the same balance as in our bot.

๐Ÿงฉ Simple

GET requests, JSON answers, one API key. Works from any language.

๐Ÿ›ก Safe

Money is charged only when a number is issued. request_id protects you from double purchases.

๐Ÿš€ Fast

Code arrives by callback the moment it comes โ€” no polling needed.

Documentation overview

Read these documents to connect your system to our servers and buy numbers automatically. Servers, prices, stock and balance are exactly the same as in the bot. All amounts are in USD.

๐Ÿ”‘ How to get an API key?

  1. Open our Telegram bot โ€” it is the only way to get a key.
  2. Accept the terms, then press ๐Ÿ”‘ API in the main menu and copy your key.
  3. Top up the balance in the bot (๐Ÿ’ฐ My account โ†’ ๐Ÿ’ณ Top up) โ€” API purchases use the same balance.

Base URL

GEThttps://moonum-tg.com/v2/

Authentication

Send the key in the X-Api-Key header (recommended โ€” keys in URLs end up in server logs) or as the api_key parameter. Never share your key; if it leaks, press โ™ป๏ธ Change key in the bot.

Servers

There are 5 servers โ€” the same ones, in the same order, as in the bot. Each server has its own country list, prices and stock, so always pass the same server to getCountries and getNumber.

serverNameWhat you getCountriesFrom
1No Spam 100%Clean accounts, no spam block. 186$0.21
2low priceNumbers with a login code, low price. 183$0.30
3spam accountsAccounts with a spam block (can't message strangers first) โ€” cheaper. 68$0.20
4No GuaranteeThe cheapest accounts, sold as is โ€” no guarantee. 188$0.18
5SessionsReady-to-use Telegram sessions (Telethon string) โ€” delivered instantly, no code needed. 188$0.20

Methods

All methods: GET (or POST) to the base URL with the action parameter.

# getBalance

Your current balance and today's API usage.

GEThttps://moonum-tg.com/v2/?action=getBalance&api_key=YOUR_API_KEY
ParameterTypeRequiredDescription
api_key StringrequiredStringYesYour API key (or the X-Api-Key header)
action StringrequiredStringYesPut: getBalance
Response
{
  "ok": true,
  "balance": 12.5,
  "spent": 3.2,
  "currency": "USD",
  "api_usage": {"requests_today": 41, "limit": 5000, "remaining": 4959}
}

# getServers

List of servers and whether each one is on sale right now.

GEThttps://moonum-tg.com/v2/?action=getServers&api_key=YOUR_API_KEY
ParameterTypeRequiredDescription
api_key StringrequiredStringYesYour API key (or the X-Api-Key header)
action StringrequiredStringYesPut: getServers
Response
{
  "ok": true, "count": 5,
  "servers": [
    {"server": 1, "name": "No Spam 100%", "type": "numbers", "available": true},
    {"server": 2, "name": "low price", "type": "numbers", "available": true},
    {"server": 3, "name": "spam accounts", "type": "numbers", "available": true},
    {"server": 4, "name": "No Guarantee", "type": "numbers", "available": true},
    {"server": 5, "name": "Sessions", "type": "sessions", "available": true}
  ]
}

# getCountries

Countries on sale on the chosen server, sorted by price. stock โ€” available numbers (null โ€” available, exact amount unknown).

GEThttps://moonum-tg.com/v2/?action=getCountries&api_key=YOUR_API_KEY&server=2
ParameterTypeRequiredDescription
api_key StringrequiredStringYesYour API key (or the X-Api-Key header)
action StringrequiredStringYesPut: getCountries
server IntegerrequiredIntegerYesServer number: 1 โ€” No Spam 100%, 2 โ€” low price, 3 โ€” spam accounts, 4 โ€” No Guarantee, 5 โ€” Sessions. See Servers. Use the same value in getCountries and getNumber โ€” prices differ between servers.
Response
{
  "ok": true, "server": 2, "name": "low price", "currency": "USD", "count": 2,
  "countries": [
    {"country": "BD", "dial": "880", "name": "Bangladesh", "price": 0.35, "stock": 2146},
    {"country": "KE", "dial": "254", "name": "Kenya", "price": 0.42, "stock": null}
  ]
}

# getNumber

Buy a number on the chosen server. The price is charged only if a number is issued; if none is issued, nothing is charged. A purchase can take up to ~30 s โ€” use a generous timeout and a request_id.

GEThttps://moonum-tg.com/v2/?action=getNumber&api_key=YOUR_API_KEY&server=2&country=BD&max_price=0.40&request_id=order-1001
ParameterTypeRequiredDescription
api_key StringrequiredStringYesYour API key (or the X-Api-Key header)
action StringrequiredStringYesPut: getNumber
server IntegerrequiredIntegerYesServer number: 1 โ€” No Spam 100%, 2 โ€” low price, 3 โ€” spam accounts, 4 โ€” No Guarantee, 5 โ€” Sessions. See Servers. Use the same value in getCountries and getNumber โ€” prices differ between servers.
country StringrequiredStringYesCountry, ISO 3166-1 alpha-2 (e.g. KE)
max_price NumberoptionalNumberNoHighest price you accept. If the current price is higher you get PRICE_TOO_HIGH and nothing is charged. If omitted, the price from getCountries is the limit.
request_id StringoptionalStringNoYour unique order id (6โ€“64 chars: A-Z a-z 0-9 . _ -). Repeating a request with the same id returns the same answer instead of buying again โ€” safe to retry after timeouts.
Response
{
  "ok": true,
  "id": 1532,
  "phone": "8801712345678",
  "country": "BD",
  "price": 0.35,
  "balance": 12.15,
  "server": 2
}

# orderSessions

Sessions server (type: "sessions" in getServers): order ready-made Telegram sessions in bulk. Processing runs in the background (usually a few minutes). The money is reserved up front (quantity ร— max_price); the real price is charged when the order finishes and the difference โ€” and anything we could not find โ€” is refunded automatically. You get a ZIP: one folder per account with <phone>.session (Telethon), <phone>.json and 2fa.txt (when there is 2FA). Poll getSessionOrder or use setCallback (event session_order), then call downloadSessions.

GEThttps://moonum-tg.com/v2/?action=orderSessions&api_key=YOUR_API_KEY&server=5&country=ET&quantity=50&max_price=0.40&request_id=sess-2001
ParameterTypeRequiredDescription
api_key StringrequiredStringYesYour API key (or the X-Api-Key header)
action StringrequiredStringYesPut: orderSessions
server IntegerrequiredIntegerYesA server with type: "sessions" (see Servers)
country StringrequiredStringYesCountry, ISO 3166-1 alpha-2 (e.g. KE)
quantity IntegerrequiredIntegerYesHow many sessions (1 โ€“ 1000)
max_price NumberoptionalNumberNoHighest price per session. If higher you get PRICE_TOO_HIGH and nothing is charged. If omitted, the price from getCountries is the limit.
request_id StringoptionalStringNoYour unique order id (6โ€“64 chars: A-Z a-z 0-9 . _ -). Repeating a request with the same id returns the same answer instead of buying again โ€” safe to retry after timeouts.
Response
{
  "ok": true,
  "id": 77,
  "status": "queued",
  "server": 5,
  "country": "ET",
  "quantity": 50,
  "reserved": 20.0,
  "balance": 31.5
}

# getSessionOrder

Status of a session order. status: queued / running / done / failed. When done: delivered (may be less than quantity), price charged, refunded. When failed nothing is charged.

GEThttps://moonum-tg.com/v2/?action=getSessionOrder&api_key=YOUR_API_KEY&id=77
ParameterTypeRequiredDescription
api_key StringrequiredStringYesYour API key (or the X-Api-Key header)
action StringrequiredStringYesPut: getSessionOrder
id IntegerrequiredIntegerYesOrder id from orderSessions
Response
{
  "ok": true, "id": 77, "status": "done", "server": 5, "country": "ET",
  "quantity": 50, "delivered": 48, "max_price": 0.4,
  "price": 18.2, "refunded": 1.8,
  "download": "GET ?action=downloadSessions&id=77"
}

# downloadSessions

Download the finished order as a ZIP (application/zip): +<dial> Session/<phone>/<phone>.session, .json, 2fa.txt. Send your API key in the X-Api-Key header. Before the order is done you get NOT_READY (409).

GETcurl -H "X-Api-Key: YOUR_API_KEY" -o sessions.zip "https://moonum-tg.com/v2/?action=downloadSessions&id=77"
ParameterTypeRequiredDescription
api_key StringrequiredStringYesYour API key (or the X-Api-Key header)
action StringrequiredStringYesPut: downloadSessions
id IntegerrequiredIntegerYesOrder id from orderSessions
Response
(binary ZIP file)

# getCode

Login code of your number. status: wait โ€” not yet (expires_in seconds left), ok โ€” code and 2FA password (may be null), cancelled โ€” no code in time.

GEThttps://moonum-tg.com/v2/?action=getCode&api_key=YOUR_API_KEY&id=1532
ParameterTypeRequiredDescription
api_key StringrequiredStringYesYour API key (or the X-Api-Key header)
action StringrequiredStringYesPut: getCode
id IntegerrequiredIntegerYesNumber id from getNumber
Response
{"ok": true, "id": 1532, "phone": "8801712345678", "status": "wait", "expires_in": 1650}

{"ok": true, "id": 1532, "phone": "8801712345678", "status": "ok", "code": "52814", "password": "x7kq2"}

# getStatus

Number status from our database โ€” instant. Same fields as the callback.

GEThttps://moonum-tg.com/v2/?action=getStatus&api_key=YOUR_API_KEY&id=1532
ParameterTypeRequiredDescription
api_key StringrequiredStringYesYour API key (or the X-Api-Key header)
action StringrequiredStringYesPut: getStatus
id IntegerrequiredIntegerYesNumber id from getNumber
Response
{
  "ok": true, "id": 1532, "phone": "8801712345678", "country": "BD", "server": 2,
  "price": 0.35, "status": "ok", "code": "52814", "password": null,
  "refunded": 0.0, "created_at": "2026-10-14 10:15:02"
}

# setCallback

Set the URL where we POST the code (or the cancellation) as soon as it arrives. Empty url disables it. Also in the bot: ๐Ÿ”‘ API โ†’ ๐Ÿ”— Callback URL.

GEThttps://moonum-tg.com/v2/?action=setCallback&api_key=YOUR_API_KEY&url=https://example.com/hook
ParameterTypeRequiredDescription
api_key StringrequiredStringYesYour API key (or the X-Api-Key header)
action StringrequiredStringYesPut: setCallback
url StringoptionalStringNoPublic https:// URL (port 443, up to 255 chars)
Response
{"ok": true, "callback": "https://example.com/hook"}

Callback

When a code arrives or a number is cancelled we send POST with JSON (fields as in getStatus + event: code / cancelled). Verify the X-Signature header: hex HMAC-SHA256 of the raw body with your API key. Answer with any 2xx โ€” otherwise we retry up to 4 times. Handle it idempotently by id.

POST https://example.com/hook
Content-Type: application/json
X-Signature: 5f0cโ€ฆe91a

{"event": "code", "ok": true, "id": 1532, "phone": "8801712345678", "country": "BD", "server": 2, "price": 0.35,
 "status": "ok", "code": "52814", "password": null, "refunded": 0.0, "created_at": "2026-10-14 10:15:02"}

Examples

Buy a number and wait for the code:

# 1) buy
curl -H "X-Api-Key: YOUR_API_KEY" "https://moonum-tg.com/v2/?action=getNumber&server=2&country=BD&max_price=0.40&request_id=order-1001"

# 2) code (repeat every 5โ€“10 s while status = wait)
curl -H "X-Api-Key: YOUR_API_KEY" "https://moonum-tg.com/v2/?action=getCode&id=1532"
<?php
$key = 'YOUR_API_KEY';
function api(array $q) {
    global $key;
    $ctx = stream_context_create(['http' => ['header' => "X-Api-Key: $key\r\n"]]);
    return json_decode(file_get_contents('https://moonum-tg.com/v2/?' . http_build_query($q), false, $ctx), true);
}

$n = api(['action' => 'getNumber', 'server' => 2, 'country' => 'BD', 'max_price' => 0.40, 'request_id' => 'order-1001']);
if (!$n['ok']) exit($n['error']);
echo "Number: {$n['phone']}\n";

do {
    sleep(7);
    $c = api(['action' => 'getCode', 'id' => $n['id']]);
} while ($c['ok'] && $c['status'] === 'wait');
echo $c['status'] === 'ok' ? "Code: {$c['code']}\n" : "No code\n";
import time, requests

API = 'https://moonum-tg.com/v2/'
H = {'X-Api-Key': 'YOUR_API_KEY'}

n = requests.get(API, headers=H, params={'action': 'getNumber', 'server': 2, 'country': 'BD',
                                        'max_price': 0.40, 'request_id': 'order-1001'}).json()
if not n['ok']:
    raise SystemExit(n['error'])
print('Number:', n['phone'])

while True:
    time.sleep(7)
    c = requests.get(API, headers=H, params={'action': 'getCode', 'id': n['id']}).json()
    if not c['ok'] or c['status'] != 'wait':
        break
print('Code:', c.get('code'))

Errors

On error: {"ok": false, "error": "CODE", "message": "..."} with a matching HTTP status.

BAD_KEYKey missing or invalid (401)
API_BLOCKEDAPI access blocked by admin (403)
BANNEDAccount blocked (403)
MAINTENANCEService temporarily off (503)
BAD_ACTIONUnknown action (400)
BAD_COUNTRY ยท BAD_MAX_PRICE ยท BAD_REQUEST_ID ยท BAD_URLInvalid parameter (400)
BAD_QUANTITYquantity is not a whole number in the allowed range (400)
WRONG_ACTIONUse orderSessions on a sessions server instead of getNumber (400)
TOO_MANY_ORDERSToo many active session orders โ€” wait until some finish (429)
NOT_READYSession order is not finished yet โ€” poll getSessionOrder (409)
BAD_SERVERserver is missing or is not a valid server number (400)
SERVER_UNAVAILABLEThis server is temporarily off โ€” choose another one, see getServers (503)
NO_NUMBERSCountry not available (404)
PRICE_TOO_HIGHPrice above max_price, current price included (409)
NO_BALANCENot enough balance, price and balance included (402)
NO_NUMBER_ISSUEDNo number was issued, nothing charged โ€” retry later (503)
IN_PROGRESSSame request_id is still being processed (409)
REQUEST_ID_USEDrequest_id already used for another action (409)
NOT_FOUNDNumber id not found (404)
RATE_LIMITToo many requests: max 300 / 10 s and 1200 / 60 s, see Retry-After (429)
DAILY_LIMITDaily request limit reached, resets tomorrow (429)
PROVIDER_ERRORCode check failed, retry (502)
INTERNALUnexpected server error โ€” check getStatus / getBalance before retrying (500)
PENDING_REVIEWRare: number reserved but not saved โ€” do not retry, contact support (500)

Important rules

Previous API version

Integrations that call https://moonum-tg.com/?action=โ€ฆ (parameters server=1|2 and kind) keep working without any changes. In that version server=1 is today's Server 2, and server=2 with kind=clean / kind=spam is today's Server 1 / Server 3. Server 4 is available only in this version. New integrations should use the base URL above.

๐Ÿ’ฌ Support

Questions, top-ups and partnership โ€” write to us in Telegram.