Phone Number Validation
Validates and normalises a phone number to E.164, classifies the line type, and resolves the province for Turkish landlines.
POST /v1/phone/validate · 1 credit · deterministic
- No account needed to try any endpoint on this page.
- Deterministic endpoints answer from cache in single-digit milliseconds.
- Every response carries a receipt: credits charged, cache status, duration.
/v1/phone/validate
{
"phone": "0532 123 45 67"
}
Press Run to call the live API from your browser.
Why this exists
Built for hostile input
A Turkish address arrives as "Cd." or "Cad." or "Caddesi", with the flat number glued to the building number. Generic parsers drop half of it silently. This one tells you what it could not place.
History cannot be backfilled
The exchange-rate archive grows every business day and each point keeps its source URL and content hash. A competitor can read today’s bulletin too — nobody can produce last quarter’s.
You only pay for work
Repeated inputs come from cache and cost zero credits. If a response ever fails its own schema, the call is refunded automatically.
Endpointsexpand any row to see the parameters and call it live
Validation1
/v1/phone/validate
Phone Number Validation
deterministic
1 credit
Validates and normalises a phone number to E.164, classifies the line type, and resolves the province for Turkish landlines.
For signup and checkout flows that need to store one canonical form and reject typos early. Turkish numbers are handled in depth: landline area codes resolve to a province, mobile and special ranges (toll-free 0800, fixed-rate 0850, premium 0900) are classified, and every accepted input comes back in both E.164 and national notation. One thing this endpoint deliberately does not claim: the current mobile operator. Turkey has had number portability since 2008, so a 0532 number may well be on another network today. Competing APIs report the prefix owner as "the operator" and customers pick SMS routes on that basis. We return it as `originallyAllocatedTo` with the caveat attached, because a confident wrong answer costs more than an honest gap.
Parameters
| phone* | string | Phone number in any common format. |
| defaultCountry | string | ISO 3166-1 alpha-2 country to assume when the number has no international prefix. Defaults to TR. |
/v1/phone/validate
{
"phone": "0532 123 45 67"
}
Press Run to call the live API from your browser.
Pricingone key covers every endpoint
- credits
- 50,000
- Rate limit
- 10/s
- credits
- 300,000
- Rate limit
- 30/s
- credits
- 2,000,000
- Rate limit
- 100/s
Credits are consumed per call and cache hits are free. Requests without a key run on a narrow per-IP demo quota so you can evaluate before signing up.
The API key is e-mailed the moment payment clears. Upgrades keep the same key, so your integration is never broken.
Use it from an AI assistantthe same catalogue, exposed as MCP tools
Every endpoint is also published over the Model Context Protocol, so Claude, ChatGPT or your own agent can call it directly — no glue code, no wrapper functions. The assistant sees the same input schemas and the same metering.
Currently 13 tools. New endpoints appear automatically; nothing to update on your side.
claude_desktop_config.json
{
"mcpServers": {
"temsor": {
"url": "https://api.temsor.com/mcp",
"headers": { "x-api-key": "fk_live_…" }
}
}
}
Quickstart
Official client: npm install temsor-api · npmjs.com/package/temsor-api
Node.js
import Client from "temsor-api";
const api = new Client({ apiKey: KEY });
const r = await api.${(() => {
const first = apis[0];
return first.slug.split(/[/-]/).map((p, i) => (i === 0 ? p : p[0].toUpperCase() + p.slice(1))).join('');
})()}(${esc(JSON.stringify(apis[0].examples[0]?.input ?? {}))});
console.log(r, r.$meta);cURL
curl -s https://api.temsor.com/v1/phone/validate \
-H "content-type: application/json" \
-H "x-api-key: fk_live_…" \
-d '{"phone":"0532 123 45 67"}'JavaScript
const res = await fetch("https://api.temsor.com/v1/phone/validate", {
method: "POST",
headers: { "content-type": "application/json", "x-api-key": KEY },
body: JSON.stringify({"phone":"0532 123 45 67"})
});
const { data } = await res.json();Python
import httpx
r = httpx.post("https://api.temsor.com/v1/phone/validate",
headers={"x-api-key": KEY},
json={"phone":"0532 123 45 67"})
data = r.json()["data"]