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?
- Open our Telegram bot โ it is the only way to get a key.
- Accept the terms, then press ๐ API in the main menu and copy your key.
- Top up the balance in the bot (๐ฐ My account โ ๐ณ Top up) โ API purchases use the same balance.
Base URL
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.
| server | Name | What you get | Countries | From |
|---|---|---|---|---|
1 | No Spam 100% | Clean accounts, no spam block. | 186 | $0.21 |
2 | low price | Numbers with a login code, low price. | 183 | $0.30 |
3 | spam accounts | Accounts with a spam block (can't message strangers first) โ cheaper. | 68 | $0.20 |
4 | No Guarantee | The cheapest accounts, sold as is โ no guarantee. | 188 | $0.18 |
5 | Sessions | Ready-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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key (or the X-Api-Key header) |
| action | String | Yes | Put: getBalance |
{
"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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key (or the X-Api-Key header) |
| action | String | Yes | Put: getServers |
{
"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).
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key (or the X-Api-Key header) |
| action | String | Yes | Put: getCountries |
| server | Integer | Yes | Server 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. |
{
"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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key (or the X-Api-Key header) |
| action | String | Yes | Put: getNumber |
| server | Integer | Yes | Server 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 | String | Yes | Country, ISO 3166-1 alpha-2 (e.g. KE) |
| max_price | Number | No | Highest 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 | String | No | Your 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. |
{
"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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key (or the X-Api-Key header) |
| action | String | Yes | Put: orderSessions |
| server | Integer | Yes | A server with type: "sessions" (see Servers) |
| country | String | Yes | Country, ISO 3166-1 alpha-2 (e.g. KE) |
| quantity | Integer | Yes | How many sessions (1 โ 1000) |
| max_price | Number | No | Highest 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 | String | No | Your 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. |
{
"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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key (or the X-Api-Key header) |
| action | String | Yes | Put: getSessionOrder |
| id | Integer | Yes | Order id from orderSessions |
{
"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).
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key (or the X-Api-Key header) |
| action | String | Yes | Put: downloadSessions |
| id | Integer | Yes | Order id from orderSessions |
(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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key (or the X-Api-Key header) |
| action | String | Yes | Put: getCode |
| id | Integer | Yes | Number id from getNumber |
{"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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key (or the X-Api-Key header) |
| action | String | Yes | Put: getStatus |
| id | Integer | Yes | Number id from getNumber |
{
"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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key (or the X-Api-Key header) |
| action | String | Yes | Put: setCallback |
| url | String | No | Public https:// URL (port 443, up to 255 chars) |
{"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_KEY | Key missing or invalid (401) |
| API_BLOCKED | API access blocked by admin (403) |
| BANNED | Account blocked (403) |
| MAINTENANCE | Service temporarily off (503) |
| BAD_ACTION | Unknown action (400) |
| BAD_COUNTRY ยท BAD_MAX_PRICE ยท BAD_REQUEST_ID ยท BAD_URL | Invalid parameter (400) |
| BAD_QUANTITY | quantity is not a whole number in the allowed range (400) |
| WRONG_ACTION | Use orderSessions on a sessions server instead of getNumber (400) |
| TOO_MANY_ORDERS | Too many active session orders โ wait until some finish (429) |
| NOT_READY | Session order is not finished yet โ poll getSessionOrder (409) |
| BAD_SERVER | server is missing or is not a valid server number (400) |
| SERVER_UNAVAILABLE | This server is temporarily off โ choose another one, see getServers (503) |
| NO_NUMBERS | Country not available (404) |
| PRICE_TOO_HIGH | Price above max_price, current price included (409) |
| NO_BALANCE | Not enough balance, price and balance included (402) |
| NO_NUMBER_ISSUED | No number was issued, nothing charged โ retry later (503) |
| IN_PROGRESS | Same request_id is still being processed (409) |
| REQUEST_ID_USED | request_id already used for another action (409) |
| NOT_FOUND | Number id not found (404) |
| RATE_LIMIT | Too many requests: max 300 / 10 s and 1200 / 60 s, see Retry-After (429) |
| DAILY_LIMIT | Daily request limit reached, resets tomorrow (429) |
| PROVIDER_ERROR | Code check failed, retry (502) |
| INTERNAL | Unexpected server error โ check getStatus / getBalance before retrying (500) |
| PENDING_REVIEW | Rare: number reserved but not saved โ do not retry, contact support (500) |
Important rules
- If the code does not arrive within 120 minutes, the number is cancelled. The payment is not refunded โ the number counts as delivered.
- If no number is issued at all, nothing is charged.
- Numbers may be frozen or banned by Telegram โ this is not grounds for a refund.
- Using the API means you accept the bot's Terms of Use.
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.