Anti-fraud API — Checks before you commit to an operation (1.0)

Download OpenAPI specification:Download

INTRODUCTION

Checks you run before taking a piece of data at face value: signing someone up, sending them a verification code or accepting a payment.



Every check goes through the same call. The SERVICIO parameter picks which one, and parameters that do not belong to that check are ignored: you can always send the same structure and only change SERVICIO. New checks (email, IP…) will arrive here, with no second URL for you to integrate.

AVAILABLE CHECKS

SERVICIOWhat it checks
DatosTelefonoWho is behind a number: the carrier serving it, its porting history (which carrier it came from and when it was ported) and the line type.

WHY PORTING DATE AND LINE TYPE

Of everything you can learn about a number without calling it, these two are the ones that actually change a decision.



The porting date. A number that changed carrier three days ago, right before a significant operation, is the signature of a SIM swap: the attacker moves the victim's number to another carrier and from then on receives their verification codes. If you are about to send a code to that number, verify through another channel first.



The line type. An Internet line (VoIP) where a mobile should be is usually a throwaway number: minutes to get, minutes to abandon. And premium-rate or machine-to-machine numbering is nobody's personal phone.



On top of that, the response carries a calculated risk from 0 to 100 with the reasons in plain text. It is not a verdict and it does not decide for you: it is what the data supports, explained, so your system can apply your own policy.

WHERE THE DATA COMES FROM

For Spanish mobile numbers we use our own porting registry, which is what lets us tell you the carrier the number came from and the exact date of the change. For Spanish landlines and any foreign number we query international numbering data. You do not have to choose: send the number and it is resolved wherever it has to be.



The Fuente field of the response tells you which was used. Not every country publishes porting history: when there is no data, Portabilidad.Consta comes back as 0 —which is not the same as «not ported», and that is why they are told apart.

PRICE

You are charged per resolved check. If it cannot be resolved the call returns -4 and nothing is charged.



The same check repeated within a minute (a double submit, a retry from your system) returns the previous result flagged with Repetida=1 and is not charged either. After that minute it is looked up again for real and charged again: the data may have changed, and yesterday's porting is precisely the one you care about.

AUTHENTICATION

Same as the rest of our APIs: Basic authentication with your user and your API Token, which you will find in your panel under Your data → Configure → Security. Remember to authorise there the public IP address you will be calling from.

Check

/Consultar

Runs an anti-fraud check. The SERVICIO parameter picks which one; with DatosTelefono it returns the carrier, the porting history and the line type of the given number, plus the calculated risk and its reasons.

Authorizations:
basicAuth
query Parameters
Servicio
string
Value: "DATOSTELEFONO"
Example: Servicio=DatosTelefono

Check you want to run. Case insensitive.
DatosTelefono - Carrier, porting history and line type of a number.

Telefono
required
string
Example: Telefono=600000000

Number to check. You may send it in national format (600000000) together with PREFIJO, or in full international format (+34600000000 or 0034600000000), in which case PREFIJO is not needed. Spaces, dashes and brackets are ignored.

Prefijo
string
Example: Prefijo=+34

International dialling code of the number's country, with or without +. Only used when TELEFONO is in national format.

Resp
string
Enum: "TXT" "JSON" "XML"
Example: Resp=JSON

Response format for this call.
JSON - You will get the response in JSON
XML - You will get the response in XML
TXT - You will get the response in plain text

Request Body schema:

Parameters are sent in the body of the POST request, either as a JSON object (Content-Type application/json, RECOMMENDED) or as an application/x-www-form-urlencoded form. In the form format, array or object parameters are sent as a JSON-encoded string. Parameter names are case-insensitive. The detailed description of each parameter is in the parameters section of this operation.

Servicio
string
Telefono
required
string
Prefijo
string
Resp
string

Responses

Response Schema:
Array
Res
required
integer <int32>

Result of the call
1 Check completed.
-1 Authentication error or IP not authorised.
-2 Not enough credits.
-3 Parameter error. The detail comes in Error.
-4 The check could not be resolved. Nothing was charged; try again in a few minutes.
-5 The given SERVICIO does not exist.

Servicio
string

Check that was run.

Consulta
string

The data that was checked, normalised to international format.

Numero
Array of arrays

The number in its different formats and its country. Nacional is the digits without the dialling code, which is what your program will want to store; Formato is the readable version for display and may come back empty. Valido set to 0 means the number is not allocated or is not valid in its country.

Linea
Array of arrays

Line type. Tipo is the stable value for your code: movil, fijo, voip, gratuito, compartido, premium, personal, m2m or desconocido. TipoTexto is the readable version.

Operadora
Array of arrays

Carrier serving the number. MCC/MNC identify the mobile network and come back empty for landlines.

Portabilidad
Array of arrays

Porting history. Consta set to 0 means that country does not publish the data, which is not the same as not having been ported. Dias is the number of days since the change (-1 if unknown): the key figure for spotting a SIM swap.

Riesgo
Array of arrays

Risk from 0 to 100, its Nivel (BAJO below 25, MEDIO up to 49, ALTO from 50) and the Motivos explaining it, in plain text. It is input for your policy, not a decision.

Fuente
string

Where the data comes from: propia (our own porting registry, Spanish mobiles) or proveedor (international numbering lookup).

Repetida
integer

Set to 1 when this is the same check run less than a minute ago: the previous result is returned and nothing was charged.

Creditos
number

Credits charged for this call.

Cred
number

Credits left after the check.

Error
string

Description of the problem when Res is negative.

Request samples

Content type
{
  • "Servicio": "DatosTelefono",
  • "Telefono": "600000000",
  • "Prefijo": "+34",
  • "Resp": "JSON"
}

Response samples

Content type
[
  • {
    }
]