73trust / 100

Phone Prefix

by Tanod utilpeek in Developer tools

x402 APIPassing, checked 4 h ago

utilpeek (Tanod) phone prefix lookup: country, line type and original network of a prefix, ambiguity reported, mobile prefixes per country. Use when an agent needs the country, line type and original network behind a phone prefix, or a country's mobile prefixes.

POST https://tanod.dev/v1/phone/prefix

Last 30 days

All checks passedSome failedAll failedNot checked

Status and outage history · Atom feed

Uptime
100%
Response time
893 ms typical, 1.1 s slowest 5%
Last check
4 h ago
Next check
any minute now

How to call it

POST https://tanod.dev/v1/phone/prefix

Each call costs $0.001 in USDC on Base, paid with the request over x402.

Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.

Example request

From the listing.

POST https://tanod.dev/v1/phone/prefix
content-type: application/json

{
  "prefix": "0917",
  "region": "PH"
}

Parameters

ParameterTypeRequiredDescription
listbooleanNoWith `region` (and no prefix): return every mobile prefix of that country at the 4-digit national level (e.g. 0905, 0917), grouped by network. Default: false.
prefixstring or nullNoThe leading digits of a number, in any form: 0917, 917, +63917, 0063917 or 63917 (digits with an optional leading + or 00; separators space - . ( ) are ignored). Without `region` a national form (0917) is read in every country and the reply lists the candidate `countries`. Omit with `list`. Default: null.
regionstring or nullNoISO 3166-1 alpha-2 country (PH, US, GB, ...): reads a national prefix and selects the country for `list`. Default: null.

Example response

The provider's example. We can't check it without paying.

Example response, 50 lines
{
  "ambiguity": "multiple_networks",
  "ambiguous": true,
  "candidates": [
    {
      "carrier": "Smart",
      "share": 0.489,
      "type": "mobile"
    },
    {
      "carrier": "Globe",
      "share": 0.386,
      "type": "mobile"
    },
    {
      "carrier": "Dito",
      "share": 0.08,
      "type": "mobile"
    },
    {
      "carrier": null,
      "share": 0.045,
      "type": "mobile"
    }
  ],
  "carrier": null,
  "country": "Philippines",
  "country_calling_code": 63,
  "interpreted_as": "national",
  "note": "Original range holder from the numbering-plan metadata: with mobile number portability (Philippines since 2021, most countries) the number's current network can differ. 'share' is the estimated fraction of the valid numbers beginning with the prefix, probed offline; it is not subscriber market share.",
  "possible": true,
  "prefix_e164": "+639",
  "probe": {
    "checks": 2331,
    "truncated": false
  },
  "region": "PH",
  "regions": [
    "PH"
  ],
  "source": {
    "library": "phonenumbers 9.0.40",
    "license": "Apache-2.0",
    "url": "https://github.com/daviddrysdale/python-phonenumbers"
  },
  "timezones": [
    "Asia/Manila"
  ],
  "type": "mobile"
}

Call it from code

The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.001.

curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://tanod.dev/v1/phone/prefix' \
  -H 'content-type: application/json' \
  --data-raw '{"prefix":"0917","region":"PH"}'

# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - -X POST 'https://tanod.dev/v1/phone/prefix' \
  -H 'content-type: application/json' \
  --data-raw '{"prefix":"0917","region":"PH"}' \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decode
JavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

// Pays at most $0.001 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.001" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.001 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Ftanod.dev%2Fv1%2Fphone%2Fprefix&method=POST
const res = await pay("https://tanod.dev/v1/phone/prefix", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    "prefix": "0917",
    "region": "PH"
  }),
});
console.log(res.status, await res.text());
Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

# Pays at most $0.001 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.001"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))

with x402_requests(client) as session:
    res = session.post(
        "https://tanod.dev/v1/phone/prefix",
        json={
            "prefix": "0917",
            "region": "PH",
        },
    )
    print(res.status_code, res.text)

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
4 h agoPassed4021.2 s$0.001
8 h agoPassed4021.1 s$0.001
12 h agoPassed402281 ms$0.001
15 h agoPassed402459 ms$0.001
19 h agoPassed4021.1 s$0.001
23 h agoPassed4021.1 s$0.001
27 h agoPassed4021.0 s$0.001
31 h agoPassed402870 ms$0.001
34 h agoPassed402478 ms$0.001
38 h agoPassed4021.0 s$0.001
41 h agoPassed402406 ms$0.001
45 h agoPassed402374 ms$0.001
2 days agoPassed4021.0 s$0.001
2 days agoPassed4021.0 s$0.001
2 days agoPassed402893 ms$0.001