CodedFone API

SMS verification numbers over a simple HTTP API. Buy a number, poll for the OTP, done.

Base endpoint: http://codedfone.com/stubs/handler_api.php
All calls are HTTP GET. Responses are plain text (except getCountries / getServices, which return JSON). Send your key as the api_key query parameter, or as an Authorization: Bearer <key> header, on every request.

1. Get an API key

1. Create an account  2. Add wallet balance  3. Open API Tool in your dashboard and copy your key (or click Change Key to rotate it).

Purchases draw from your wallet balance. Prices and balance are in NGN. Keep your key secret and call the API from your server, never from browser JavaScript.

2. How it works

1 getCountries pick a server id2 getServices pick a service id3 getPrice (optional) → 4 getNumber returns ACCESS_NUMBER:<id>:<phone>5 getStatus poll for STATUS_OK:<code>6 setStatus=8 cancel/refund if needed.

An activation with no SMS is auto-cancelled and refunded after 20 minutes. The country parameter is the numeric server id from getCountries — not an ISO country code.

3. Endpoints

GET getBalance

http://codedfone.com/stubs/handler_api.php?action=getBalance&api_key=YOUR_API_KEY

Success: ACCESS_BALANCE:1500.00 (NGN)

Errors: BAD_KEY, ACCOUNT_BLOCKED

GET getCountries

http://codedfone.com/stubs/handler_api.php?action=getCountries&api_key=YOUR_API_KEY

Success (JSON, keys are server ids you pass as country):

{"1":"United States","2":"United Kingdom","7":"Nigeria"}

Errors: BAD_KEY

GET getServices

http://codedfone.com/stubs/handler_api.php?action=getServices&api_key=YOUR_API_KEY&country=SERVER_ID

Success (JSON, keys are service ids you pass as service):

{"wa":"WhatsApp","tg":"Telegram","go":"Google"}

Errors: BAD_KEY, BAD_COUNTRY

GET getPrice

http://codedfone.com/stubs/handler_api.php?action=getPrice&api_key=YOUR_API_KEY&service=SERVICE_ID&country=SERVER_ID

Success: PRICE:150.00:WhatsApp

Errors: BAD_KEY, BAD_SERVICE, BAD_COUNTRY

GET getNumber  — purchase a number

http://codedfone.com/stubs/handler_api.php?action=getNumber&api_key=YOUR_API_KEY&service=SERVICE_ID&country=SERVER_ID

Success: ACCESS_NUMBER:<id>:<phone> — e.g. ACCESS_NUMBER:a1b2c3d4e5:447700900123.

Save <id> — you pass it to getStatus / setStatus. <phone> is the number to enter on the target site.

ResponseMeaning
TRY_AGAINTemporary (provider busy/slow, or another buy is in flight on your key). No charge made — retry shortly.
NO_API_NUMBERNo numbers in stock right now — try again later.
NO_BALANCENot enough wallet balance.
BAD_SERVICE / BAD_COUNTRYInvalid service id or server id.
BAD_KEY / ACCOUNT_BLOCKEDBad key, or account disabled.

GET getStatus  — poll for the OTP

http://codedfone.com/stubs/handler_api.php?action=getStatus&api_key=YOUR_API_KEY&id=ACTIVATION_ID

id = the <id> returned by getNumber. Poll about every 5 seconds.

ResponseMeaning
STATUS_OK:123456SMS received. The code is everything after STATUS_OK:
STATUS_WAIT_CODENumber ready, still waiting for the SMS. Keep polling.
TRY_AGAINTemporary, retry.
STATUS_CANCELCancelled. If no SMS had arrived you are auto-refunded (also happens automatically after 20 min).
BAD_KEY / NO_ACTIVATIONBad key, or no activation for this id.

GET setStatus  — cancel or request another SMS

http://codedfone.com/stubs/handler_api.php?action=setStatus&api_key=YOUR_API_KEY&id=ACTIVATION_ID&status=STATUS

status=8 cancel (refunds if no SMS arrived) → STATUS_CANCEL
status=3 request another SMS → ACCESS_RETRY_GET

Errors: BAD_KEY, NO_ACTIVATION

4. Quick start (code)

<?php
$base = "http://codedfone.com/stubs/handler_api.php";
$key  = "YOUR_API_KEY";

function call($url){ return trim(file_get_contents($url)); }

// 1. buy a number (service + numeric server id)
$res = call("$base?action=getNumber&api_key=$key&service=wa&country=1");
if (strpos($res, "ACCESS_NUMBER:") !== 0) { exit("buy failed: $res"); }
[, $id, $phone] = explode(":", $res);
echo "Got $phone (id $id)\n";

// 2. poll for the code
for ($i = 0; $i < 60; $i++) {
    $s = call("$base?action=getStatus&api_key=$key&id=$id");
    if (strpos($s, "STATUS_OK:") === 0) { echo "Code: " . substr($s, 10) . "\n"; break; }
    if ($s === "STATUS_CANCEL") { echo "Cancelled/refunded\n"; break; }
    sleep(5);
}
const base = "http://codedfone.com/stubs/handler_api.php";
const key  = "YOUR_API_KEY";
const call = async (q) => (await fetch(`${base}?${q}`)).text();
const sleep = (ms) => new Promise(r => setTimeout(r, ms));

(async () => {
  let res = (await call(`action=getNumber&api_key=${key}&service=wa&country=1`)).trim();
  if (!res.startsWith("ACCESS_NUMBER:")) return console.error("buy failed:", res);
  const [, id, phone] = res.split(":");
  console.log("Got", phone, "id", id);

  for (let i = 0; i < 60; i++) {
    const s = (await call(`action=getStatus&api_key=${key}&id=${id}`)).trim();
    if (s.startsWith("STATUS_OK:")) { console.log("Code:", s.slice(10)); break; }
    if (s === "STATUS_CANCEL") { console.log("Cancelled/refunded"); break; }
    await sleep(5000);
  }
})();
import time, requests

base = "http://codedfone.com/stubs/handler_api.php"
key  = "YOUR_API_KEY"
def call(q): return requests.get(base, params=q, timeout=30).text.strip()

res = call({"action":"getNumber","api_key":key,"service":"wa","country":"1"})
if not res.startswith("ACCESS_NUMBER:"):
    raise SystemExit(f"buy failed: {res}")
_, id, phone = res.split(":")
print("Got", phone, "id", id)

for _ in range(60):
    s = call({"action":"getStatus","api_key":key,"id":id})
    if s.startswith("STATUS_OK:"): print("Code:", s[10:]); break
    if s == "STATUS_CANCEL": print("Cancelled/refunded"); break
    time.sleep(5)

Questions? Contact support.