> For the complete documentation index, see [llms.txt](https://docs.whiteintel.io/whiteintel-api-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.whiteintel.io/whiteintel-api-doc/whiteintel-api-v1/infostealer-api/get-multiple-leaks-by-ids.md).

# Get Multiple Leaks By Ids

### Description

This API endpoint allows users to retrieve leaks by using the id values of stealer dataset records.

{% hint style="info" %}
For collecting ID values please check Get IDs From Leaks API endpoint.
{% endhint %}

### Endpoint

`POST /api/get_leaks_by_ids.php`

### Required Headers

| Name         | Description                       |
| ------------ | --------------------------------- |
| Content-Type | Must be set to `application/json` |

### Parameters

| Name       | Type   | Required | Default | Description                                 |
| ---------- | ------ | -------- | ------- | ------------------------------------------- |
| query      | string | Yes      | N/A     | The query to search for leaks (eg: abc.com) |
| apikey     | string | Yes      | N/A     | Your API key.                               |
| leak\_type | string | Yes      | N/A     | Type of leaks: customer or corporate.       |
| ids        | array  | Yes      | N/A     | Array of intiger id values                  |

### Sample Request

#### Request URL

POST /api/get\_leaks\_by\_ids.php

```json
{
  "apikey":"yourapikey",
 "leak_type":"customer", 
 "query":"123.com",
 "ids":[123, 42232]
    
}
```

#### Example Success Response

```json
{"remaining_daily_api_calls":1992,"leaks":[{"id":1328717,"compromised_host_username":"HOSTUSERNAME","compromised_host_hostname":"HOSTNAME","compromised_host_os":"Windows 10 (10.0.19045) x64","malware_path":"C:\\Users\\\\AppData\\Local\\Temp\\PATH.EXE","country":"IT","log_date":"2024-02-29","credentials":[{"url":"url.com","username":"username","password":"[NOT_SAVED]"}]}]}
```

#### Example Error Response

```json
{"error":"Invalid type."}
```

### Code Examples

Example with Curl

```bash
curl -X POST https://whiteintel.io/api/get_leaks_by_ids.php \
     -H "Content-Type: application/json" \
     -d '{
     "apikey":"yourapikey",
      "leak_type":"customer", 
      "query":"123.com",
      "ids":[123, 42232]
    
          }'
```

Example with Python

```python

import requests

url = "https://whiteintel.io/api/get_leaks_by_ids.php"
payload = {
  "apikey":"yourapikey",
 "leak_type":"customer", 
         "query":"123.com",
         "ids":[123, 42232]
}
headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

if response.status_code == 200:
    print("Response:", response.json())
else:
    print("Failed to retrieve ids:", response.status_code, response.text)

```
