> For the complete documentation index, see [llms.txt](https://docs.looplookup.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.looplookup.com/lookup-api/bulk-lookup.md).

# Bulk lookup

Bulk lookup is designed to accept a list of contacts and automatically apply all limits and intervals from your account to the lookup. Once your list is processed, you will receive an email with the CSV results.

To handle bulk lookup results through the API, you need to observe Callbacks or use the API method to check the status by the request ID you received in the JSON response. Please check the best-practice section to determine which API request is best for your use case.

<mark style="color:green;">`POST`</mark> `https://a.looplookup.com/api/v1/lookup/`

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Authorization<mark style="color:red;">\*</mark> | String | API Key          |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json |

{% hint style="info" %}
If you need to send a large volume of contacts, please don't send more than 2-3 thousand contacts in each bulk request. Our server will keep connection only for 30 seconds, if we're unable to process your volume during this time your request may be rejected.
{% endhint %}

#### Request Body

<table><thead><tr><th width="182.80859375">Name</th><th width="116.2265625">Type</th><th>Description</th></tr></thead><tbody><tr><td>contacts<mark style="color:red;">*</mark></td><td>Array</td><td><p>An array of contacts. Should contains phone numbers in international formats or emails. Example: ["+13231112233", "steve@mac.com", “1(787)111-22-33”].</p><p>Invalid recipients will be skipped.</p></td></tr><tr><td>services<mark style="color:red;">*</mark></td><td>Array</td><td>Services that need to be looked up. Possible values: <code>imessage</code>, <code>facetime</code>, <code>whatsapp</code>. You should pass it as an array of strings: <code>"services": ["imessage", "whatsapp"]</code>. WhatsApp doesn't work with email addresses.</td></tr><tr><td>contact_details</td><td>bool</td><td>Callback/Webhook will contain additional information related to the phone number. For example: carrier name, number type (landline or mobile), country, timezone and etc. Requests with this parameter may take a little bit more time.</td></tr><tr><td>region</td><td>String</td><td><p>Value in <a href="https://en.wikipedia.org/wiki/ISO_3166-2">ISO-2 country code</a>. For example: <code>US</code>, <code>GB</code>, <code>CA</code> <code>AU</code>, etc.</p><p>This parameter should be passed only if you passed phone numbers without a country code.</p></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK Request accepted" %}

```json
{
  "success": true,
  "requests": [
    {
      "contact": "+13231112233",
      "request_id": "2BC4FD6A-CE49-439F-81DF-E895C09CA49C"
    }
  ]
}
```

A phone number will be converted to the next format `+13231112233`, without spaces and brackets. An email will be converted into a lowercase format.
{% endtab %}

{% tab title="400: Bad Request Request failed" %}

```javascript
{
    "success": false,
    "code": 100,
    "message": "Failed description",
}
```

{% endtab %}

{% tab title="402: Payment Required No available request. Need purchase additional requests." %}

```javascript
{
    "success": false,
    "code": 400,
    "message": "Failed description",
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Supported phone number formats**

Recipient phone numbers should be only in international formats with a country code. Otherwise will be impossible to verify a phone number.

Plus prefix `+` is optional. Spaces, dashes '`-`', brackets '`(123)`' - also optional.&#x20;

Valid phone number format examples:

* 13231234567
* +13231111111&#x20;
* +1 (323) 1111111
* +1 323 123 4567
* 1 (323)-123-4567

{% endhint %}

{% hint style="warning" %}
**Important**

**When you receive a successful response with code `200`, it means that the server accepted your request for lookup and added it to the queue.**&#x20;

To handle bulk lookup results for your requests, need to observe Callbacks or use the API method to check the status by request ID, which you received in the JSON response.&#x20;

We recommend using callbacks to track statuses, as you will receive a response as soon as the results are ready.
{% endhint %}

### Cancel bulk request

<mark style="color:red;">`DELETE`</mark> `https://a.looplookup.com/api/v1/bulk-lookup/delete/{id}/`

#### Path Parameters

| Name                                 | Type   | Description       |
| ------------------------------------ | ------ | ----------------- |
| id<mark style="color:red;">\*</mark> | String | Bulk request `ID` |

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Authorization<mark style="color:red;">\*</mark> | String | API Key          |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json |

{% tabs %}
{% tab title="200: OK Request accepted" %}

```json
{
  "success": true,
  "requests": [
    {
      "contact": "+13231112233",
      "request_id": "2BC4FD6A-CE49-439F-81DF-E895C09CA49C"
    }
  ]
}
```

A phone number will be converted to the next format `+13231112233`, without spaces and brackets. An email will be converted into a lowercase format.
{% endtab %}

{% tab title="400: Bad Request Request failed" %}

```javascript
{
    "success": false,
    "code": 100,
    "message": "Failed description",
}
```

{% endtab %}
{% endtabs %}

### Failed requests

If your request has a failed status, you will receive a JSON response with the following format:

{% hint style="info" %}
The "message" field is optional and is intended to briefly inform the developer about the cause of the error. Please do not pass this to the destination users who initiated the message request. Use the "code" field to map errors and show localized error text to them.
{% endhint %}

```json
{
    "success": false,
    "code": 100,
    "message": "string"
}
```

Then you can match the [error code](https://docs.looplookup.com/lookup-api/error-codes.md) to determine what may be wrong.

### Limits

Bulk lookup requests may accept up to 5k contacts per request.
