SIM swap detection

SIM swap detection API

A SIM swap API tells you whether the SIM card behind a phone number was recently replaced, so you can step up authentication or block a transaction before an account is taken over. The Telebase SIM swap detection API returns SWAPPED, NO_SWAP or UNKNOWN for a fixed 10-day window, with the time of the swap where the provider supplies it. Carrier, country, number type and number validity come back in the same call. This page covers what SIM swap detection is, what the API returns, how to integrate it and how to choose between providers.

What is SIM swap detection?

SIM swap detection is a check that tells you whether the SIM card behind a phone number was recently replaced. It matters because an attacker who moves a victim's number onto a SIM they control receives the victim's SMS codes. Run before a one-time password or a sensitive action, the check lets you step up authentication or block the action.

You send a phone number in E.164 format. The check returns whether the SIM associated with that number was replaced within a fixed window, using carrier network data. In Telebase the window is 240 hours (ten days), returned with every definite answer as simSwapPeriod: "PT240H". Where the provider supplies it, the response also carries the time of the swap in simSwapAt.

The three possible answers

AnswerWhat it meansCharged
SWAPPEDThe SIM was replaced within the 240-hour window.Yes, €0.20
NO_SWAPNo replacement was found within the 240-hour window.Yes, €0.20
UNKNOWNThe provider gave no answer for that number. This is not evidence that no swap happened.No

Errors, invalid numbers and sandbox lookups are also free. Treat UNKNOWN as "signal unavailable" and fall back to your other risk signals.

What a SIM swap check does not tell you

What the API returns

A single call to the Telebase lookup endpoint returns all available signals for the queried number. The SIM swap field is the headline signal for fraud and authentication use cases.

FieldTypeDescription
simSwapstringSWAPPED, NO_SWAP, or UNKNOWN. SWAPPED and NO_SWAP are definite answers for the fixed 10-day window. UNKNOWN means the provider had no answer and does not mean no swap.
simSwapAtstring | nullISO 8601 timestamp of the swap, present only when the provider sends it. Can be null.
simSwapPeriodstring | nullThe window the answer covers, as an ISO 8601 duration: PT240H (10 days) for a definite answer, null when simSwap is UNKNOWN.
activeboolean | nulltrue when the provider confirms the number's format is valid, otherwise null. Never false.
carrierstring | nullThe network operator currently serving the number.
countrystring | nullISO 3166-1 alpha-2 country code.
numberTypestring | nullOne of: mobile, landline, tollFree, premium. Null when it cannot be determined. VoIP and virtual numbers return null.

Every field is defined in the response field reference.

Example call

Request
GET https://app.telebase.io/v1/lookup?phone=%2B447700900002
Authorization: Bearer tb_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Response, 200 OK
{
  "phoneNumber": "+447700900002",
  "active": true,
  "carrier": "Telebase Test Carrier",
  "country": "GB",
  "numberType": "mobile",
  "simSwap": "NO_SWAP",
  "simSwapAt": "2026-09-22T09:16:03.003Z",
  "simSwapPeriod": "PT240H",
  "_meta": { "environment": "test", "activeSource": "SYNTHETIC" },
  "chargedCents": 0,
  "currency": "EUR"
}

A free sandbox account returns simulated results with no funds or provider credentials. Three test numbers cover each outcome:

Test numberReturns
+447700900001SWAPPED
+447700900002NO_SWAP
+447700900003UNKNOWN

How to integrate

Where to use it

For the background on the attack itself, see SIM swap fraud explained for risk teams.

How to choose a SIM swap API

When comparing providers, ask the same six questions of each, and ask to see a real response for every outcome.

1. What window does the answer cover?

A SIM swap answer is only meaningful against a defined window. If it is shorter than your risk period you miss recent swaps; if it is longer you flag people who changed SIM months ago. Telebase covers a fixed 240-hour window and returns it as simSwapPeriod with every definite answer, so the window is stated in the data, not assumed.

2. Does it separate "no swap" from "no answer"?

This is the most important question. An API that returns a negative result when it simply has no data creates false confidence, and the fraud it misses is invisible. Telebase returns three states, and UNKNOWN is never a hidden NO_SWAP.

3. What do you pay when it cannot answer?

Ask whether failed, invalid and unanswerable requests are billed. Telebase charges €0.20 only for a definite SWAPPED or NO_SWAP answer, and each response reports the actual debit in chargedCents and currency, so billing can be checked call by call.

4. Can you test it before you commit?

You should see real response shapes before any commercial conversation. A Telebase sandbox account is free, starts straight after sign-up and returns simulated results for the three test numbers above. Production access is approved before live keys are issued, with a prepaid balance, no annual commitment and no monthly fee.

5. What else comes back in the same call?

Fraud decisions rarely rest on one field. Carrier, country, number type and number validity come back alongside the SIM swap answer at no extra charge. Number validity is a format check, not proof that a line is active or reachable.

6. Is the response contract clear enough to automate?

If a fraud decision is made by code or by an agent, field definitions must be unambiguous. Telebase publishes a machine-readable manual at skills.md with every field, value and limit defined. Default limits are 200 lookups per key and 1,000 per account in any rolling 24 hours.

QuestionTelebase
Window coveredFixed 240 hours, stated in every response
No swap vs no answerNO_SWAP and UNKNOWN are separate
Billing on no answerNot charged
TestingFree sandbox, three test numbers
Same-call contextCarrier, country, number type, number validity
ContractDocumented in skills.md and the field reference

To see how the check fits into a login flow, start with how to detect a SIM swap before sending an OTP.

Telebase detects recent SIM swaps with a single API call.

Create a sandbox account to test all three outcomes. Carrier, country, number type and number validity come back in the same response.

Get sandbox access