Phone Lookup
curl --request POST \
--url https://encrata.com/api/agent/phone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>"
}
'import requests
url = "https://encrata.com/api/agent/phone"
payload = { "query": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: '<string>'})
};
fetch('https://encrata.com/api/agent/phone', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://encrata.com/api/agent/phone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://encrata.com/api/agent/phone"
payload := strings.NewReader("{\n \"query\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://encrata.com/api/agent/phone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://encrata.com/api/agent/phone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"query": "<string>",
"phone": "<string>",
"valid": true,
"format": {
"international": "<string>",
"local": "<string>"
},
"country": {
"code": "<string>",
"name": "<string>",
"prefix": "<string>",
"region": "<string>",
"city": "<string>",
"timezone": "<string>"
},
"type": "<string>",
"carrier": {
"name": "<string>",
"line_type": "<string>"
},
"messaging": {
"sms_domain": "<string>",
"sms_email": "<string>"
},
"validation": {
"is_valid": true,
"line_status": "<string>",
"is_voip": true,
"minimum_age": 123
},
"registration": {
"name": "<string>",
"type": "<string>"
},
"risk": {
"risk_level": "<string>",
"is_disposable": true,
"is_abuse_detected": true
},
"breaches": {
"total_breaches": 123,
"date_first_breached": "<string>",
"date_last_breached": "<string>"
},
"credits": 123
}Lookups
Phone Lookup
Look up intelligence about a phone number carrier, line type, format, country, messaging gateway, validation, risk assessment, and breach exposure. Costs 1 credit.
POST
/
api
/
agent
/
phone
Phone Lookup
curl --request POST \
--url https://encrata.com/api/agent/phone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>"
}
'import requests
url = "https://encrata.com/api/agent/phone"
payload = { "query": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: '<string>'})
};
fetch('https://encrata.com/api/agent/phone', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://encrata.com/api/agent/phone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://encrata.com/api/agent/phone"
payload := strings.NewReader("{\n \"query\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://encrata.com/api/agent/phone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://encrata.com/api/agent/phone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"query": "<string>",
"phone": "<string>",
"valid": true,
"format": {
"international": "<string>",
"local": "<string>"
},
"country": {
"code": "<string>",
"name": "<string>",
"prefix": "<string>",
"region": "<string>",
"city": "<string>",
"timezone": "<string>"
},
"type": "<string>",
"carrier": {
"name": "<string>",
"line_type": "<string>"
},
"messaging": {
"sms_domain": "<string>",
"sms_email": "<string>"
},
"validation": {
"is_valid": true,
"line_status": "<string>",
"is_voip": true,
"minimum_age": 123
},
"registration": {
"name": "<string>",
"type": "<string>"
},
"risk": {
"risk_level": "<string>",
"is_disposable": true,
"is_abuse_detected": true
},
"breaches": {
"total_breaches": 123,
"date_first_breached": "<string>",
"date_last_breached": "<string>"
},
"credits": 123
}Authentication
Requires an API key in theAuthorization header.
Authorization: Bearer YOUR_API_KEY
Request
The phone number to look up. Include the country code (e.g.
+14155552671).Example request
curl -X POST "https://encrata.com/api/agent/phone" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "+14155552671"}'
from encrata import Encrata
client = Encrata("YOUR_API_KEY")
result = client.phone_lookup("+14155552671")
print(result.carrier.name) # "T-Mobile"
print(result.country.name) # "United States"
print(result.validation.is_voip) # False
const resp = await fetch("https://encrata.com/api/agent/phone", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({ query: "+14155552671" }),
});
const data = await resp.json();
body := `{"query": "+14155552671"}`
req, _ := http.NewRequest("POST", "https://encrata.com/api/agent/phone",
strings.NewReader(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
Response
The original query submitted.
The normalized phone number.
Whether the phone number is valid.
Line type:
mobile, landline, voip, toll_free, etc.Credits consumed (always 1).
Example response
200 OK
{
"query": "+14155552671",
"phone": "+14155552671",
"valid": true,
"format": {
"international": "+1 415-555-2671",
"local": "(415) 555-2671"
},
"country": {
"code": "US",
"name": "United States",
"prefix": "+1",
"region": "California",
"city": "San Francisco",
"timezone": "America/Los_Angeles"
},
"location": "San Francisco, California, US",
"type": "mobile",
"carrier": {
"name": "T-Mobile",
"line_type": "mobile"
},
"messaging": {
"sms_domain": "tmomail.net",
"sms_email": "4155552671@tmomail.net"
},
"validation": {
"is_valid": true,
"line_status": "active",
"is_voip": false,
"minimum_age": 3
},
"registration": {
"name": "John Doe",
"type": "personal"
},
"risk": {
"risk_level": "low",
"is_disposable": false,
"is_abuse_detected": false
},
"breaches": {
"total_breaches": 2,
"date_first_breached": "2021-03-15",
"date_last_breached": "2024-08-22"
},
"credits": 1
}
Notes
- This endpoint costs 1 credit per lookup.
- Include the country code for best results (e.g.
+1for US,+44for UK). - All sections (messaging, validation, registration, risk, breaches) are returned when available from the upstream provider.
⌘I