> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encrata.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> ## Submitting feedback
> If you find an error, a missing step, or information that is outdated or misleading on this page — especially if it stopped you from completing your task — report it so the Encrata docs team can fix it.
> Send a POST request to https://docs.encrata.com/feedback with a JSON body containing `path` (the full URL of the page, for example `https://docs.encrata.com/quickstart`) and `feedback` (what was wrong and what you expected):
> curl -X POST https://docs.encrata.com/feedback -H 'Content-Type: application/json' -d '{"path": "https://docs.encrata.com/quickstart", "feedback": "Step 3 uses a parameter that the API rejects."}'
> Do not include API keys, personal data, or other secrets in your feedback.

# Phone Search

> Get the full report for a phone number: format, country, carrier, line type, validation, risk, and breaches. 1 credit.

Phone Search returns everything Encrata knows about a phone number in one call.
Use `include` to return only the sections you need.

`POST /api/lookup/phone/search`

Requires an [Encrata API key](https://docs.encrata.com/authentication.md) in the `Authorization` header.

## Request

**query** `string` *required*

The phone number in E.164 format, for example `+14155552671`. See
[Send the number in E.164 format](https://docs.encrata.com/api-reference/endpoint/phone-lookup.md#send-the-number-in-e164-format).

**include** `string[]`

The sections to return. Leave it out to get every section.

| Value | Returns |
| - | - |
| `format` | `format` |
| `country` | `country` and `location` |
| `carrier` | `carrier` |
| `line_type` | `type` |
| `messaging` | `messaging` |
| `validation` | `validation` |
| `registration` | `registration` |
| `risk` | `risk` |
| `breaches` | `breaches` |
| `free` | `format`, `country`, `carrier`, and `line_type` |
| `all` | Every section |

Unknown values are ignored. A section you leave out comes back as `null`, or
`""` for `location` and `type`.

> [!NOTE]
>
> `include` changes what you get back, not what you pay. A filtered search
> still costs 1 credit and isn't served as a free repeat.

### Example request

```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -X POST "https://developer.encrata.com/api/lookup/phone/search" \
  -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"query": "+14155552671"}'
```

```python Python theme={"theme":{"light":"github-light","dark":"vesper"}}
import requests

resp = requests.post(
    "https://developer.encrata.com/api/lookup/phone/search",
    headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},
    json={"query": "+14155552671"},
)
print(resp.json())
```

```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}}
const resp = await fetch("https://developer.encrata.com/api/lookup/phone/search", {
  method: "POST",
  headers: {
    Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ query: "+14155552671" }),
});
const data = await resp.json();
```

Return only the free sections:

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -X POST "https://developer.encrata.com/api/lookup/phone/search" \
  -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"query": "+14155552671", "include": ["free"]}'
```

## Response

The lookup is in `result`. `message` is `Phone search complete.`

**query** `string`

The number you looked up, in E.164 format.

**phone** `string`

The number as the data source returned it.

**valid** `boolean`

`true` when the number is correctly formed and dialable.

**format** `object | null`

How to write the number.

**properties**

**international** `string`

International format, for example `+1 415-555-2671`.

**local** `string`

National format, for example `(415) 555-2671`.

**country** `object | null`

Where the number is registered.

**properties**

**code** `string`

ISO 3166-1 alpha-2 code, for example `US`.

**name** `string`

Country name.

**prefix** `string`

Dialling code, for example `+1`.

**region** `string`

State or region, when known.

**city** `string`

City, when known.

**timezone** `string`

IANA time zone, when known.

**location** `string`

A readable location. Can be `""`.

**type** `string`

The line type, for example `mobile`, `landline`, `voip`, or `toll_free`.

**carrier** `object | null`

The network operator.

**properties**

**name** `string`

Carrier name. Can be `""`.

**line\_type** `string`

The carrier's line type.

**messaging** `object`

The carrier's email-to-SMS gateway. Left out when unknown.

**properties**

**sms\_domain** `string`

Gateway domain.

**sms\_email** `string`

Address that delivers an email to this number as an SMS.

**validation** `object`

Whether the line is live. Left out when unknown.

**properties**

**is\_valid** `boolean`

`true` when the number is valid.

**line\_status** `string`

Line status, for example `active`.

**is\_voip** `boolean`

`true` for a VoIP line.

**minimum\_age** `number`

Minimum age of the number's current assignment, in days. `0` when unknown.

**registration** `object`

Who the number is registered to. Left out when unknown.

**properties**

**name** `string`

Registered name.

**type** `string`

Registration type, for example `business` or `personal`.

**risk** `object`

Fraud signals. Left out when unknown. For a ready-made verdict, use
[Phone Risk](https://docs.encrata.com/api-reference/endpoint/phone-risk.md).

**properties**

**risk\_level** `string`

`low`, `medium`, or `high`.

**is\_disposable** `boolean`

`true` for a temporary or burner number.

**is\_abuse\_detected** `boolean`

`true` when the number was reported for abuse or fraud.

**breaches** `object`

Breach exposure. Left out when unknown.

**properties**

**total\_breaches** `number`

Number of known breaches the number appears in.

**date\_first\_breached** `string`

Date of the earliest breach.

**date\_last\_breached** `string`

Date of the latest breach.

**credits** `number`

Credits charged: `1`, or `0` for a free repeat.

**cached** `boolean`

Present and `true` only on a free repeat, when the result is your own earlier
search of this number from the last 14 days.

## Errors

See [Phone Lookup errors](https://docs.encrata.com/api-reference/endpoint/phone-lookup.md#errors). Search
adds no other cases.

## Credits

Each search costs **1 credit**. Searching the same number again within 14 days
returns your earlier result for free, with `credits: 0` and `cached: true`. A
search with a filtered `include` is always charged. `+14155552671` is a free
sample number.

```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -X POST "https://developer.encrata.com/api/lookup/phone/search" \
  -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"query": "+14155552671"}'
```

```json 200 theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "success": true,
  "result": {
    "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",
    "type": "mobile",
    "carrier": { "name": "T-Mobile USA, Inc.", "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": 1240
    },
    "registration": { "name": "", "type": "personal" },
    "risk": {
      "risk_level": "low",
      "is_disposable": false,
      "is_abuse_detected": false
    },
    "breaches": {
      "total_breaches": 2,
      "date_first_breached": "2019-07-24",
      "date_last_breached": "2021-04-03"
    },
    "credits": 0
  },
  "message": "Phone search complete."
}
```

```json 200 include free theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "success": true,
  "result": {
    "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",
    "type": "mobile",
    "carrier": { "name": "T-Mobile USA, Inc.", "line_type": "mobile" },
    "credits": 0
  },
  "message": "Phone search complete."
}
```

```json 400 theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "success": false,
  "result": { "code": "validation_failed" },
  "message": "A valid phone number is required."
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.