> 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/overall-stats-api.md).

# Overall Stats API

## Description

The Overall Stats API allows users to retrieve various statistical data about a domain. The request must include an API key for authentication and a query parameter specifying the domain. Other parameters are optional and can be used to exclude certain parts of the statistics.

## Endpoint

`POST /api/get_overall_stats.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 domain to query statistics for      |
| apikey                            | string | Yes      | N/A     | The API key for authentication          |
| exclude\_country\_stats           | int    | No       | 0       | Exclude country statistics (0 or 1)     |
| exclude\_top\_urls\_customers     | int    | No       | 0       | Exclude top URLs for customers (0 or 1) |
| exclude\_top\_urls\_employees     | int    | No       | 0       | Exclude top URLs for employees (0 or 1) |
| exclude\_timeline\_for\_customers | int    | No       | 0       | Exclude timeline for customers (0 or 1) |
| exclude\_timeline\_for\_employees | int    | No       | 0       | Exclude timeline for employees (0 or 1) |

## Sample Request

### Request URL

POST /api/get\_overall\_stats.php

### Example Request Body

```json
{
    "query": "example.com",
    "apikey": "your_api_key_here",
    "exclude_country_stats": 1

}
```

### Example Success Response

```json
{"leak_devices_count":[{"devices":3894}],"leak_customers_count":[{"customers":10925}],"leak_employees_count":[{"employees":22}],"leak_customers_timeline":[{"Year":1000,"Month":4,"CredentialsCount":3},{"Year":2000,"Month":4,"CredentialsCount":8},{"Year":2000,"Month":5,"CredentialsCount":13},{"Year":2020,"Month":8,"CredentialsCount":2},{"Year":2022,"Month":2,"CredentialsCount":1},{"Year":2022,"Month":3,"CredentialsCount":6},{"Year":2022,"Month":4,"CredentialsCount":2},{"Year":2022,"Month":7,"CredentialsCount":5},{"Year":2022,"Month":8,"CredentialsCount":4},{"Year":2022,"Month":10,"CredentialsCount":18},{"Year":2022,"Month":11,"CredentialsCount":2},{"Year":2022,"Month":12,"CredentialsCount":150},{"Year":2023,"Month":1,"CredentialsCount":341},{"Year":2023,"Month":2,"CredentialsCount":392},{"Year":2023,"Month":3,"CredentialsCount":251},{"Year":2023,"Month":4,"CredentialsCount":138},{"Year":2023,"Month":5,"CredentialsCount":455},{"Year":2023,"Month":6,"CredentialsCount":591},{"Year":2023,"Month":7,"CredentialsCount":142},{"Year":2023,"Month":8,"CredentialsCount":171},{"Year":2023,"Month":9,"CredentialsCount":732},{"Year":2023,"Month":10,"CredentialsCount":1649},{"Year":2023,"Month":11,"CredentialsCount":1328},{"Year":2023,"Month":12,"CredentialsCount":1263},{"Year":2024,"Month":1,"CredentialsCount":968},{"Year":2024,"Month":2,"CredentialsCount":573},{"Year":2024,"Month":3,"CredentialsCount":735},{"Year":2024,"Month":4,"CredentialsCount":550},{"Year":2024,"Month":5,"CredentialsCount":432}],"leak_employees_timeline":[{"Year":2023,"Month":7,"CredentialsCount":1},{"Year":2023,"Month":8,"CredentialsCount":1},{"Year":2023,"Month":10,"CredentialsCount":5},{"Year":2023,"Month":12,"CredentialsCount":1},{"Year":2024,"Month":1,"CredentialsCount":7},{"Year":2024,"Month":2,"CredentialsCount":7}],"remaining_daily_api_limit":180}
```

### Example Error Response

```json

{"error":"Invalid domain."}

```

## Code Examples

### Curl Example

```bash
curl -X POST https://whiteintel.io/api/get_overall_stats.php\
     -H "Content-Type: application/json" \
     -d '{
           "query": "example.com",
           "apikey": "your_api_key_here",
           "exclude_country_stats": 0,
           "exclude_top_urls_customers": 0,
           "exclude_top_urls_employees": 0,
           "exclude_timeline_for_customers": 0,
           "exclude_timeline_for_employees": 0
         }'

```

### Python Example

```python
import requests

url = "https://whiteintel.io/api/get_overall_stats.php"
payload = {
    "query": "example.com",
    "apikey": "your_api_key_here",
    "exclude_country_stats": 0,
    "exclude_top_urls_customers": 0,
    "exclude_top_urls_employees": 0,
    "exclude_timeline_for_customers": 0,
    "exclude_timeline_for_employees": 0
}
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 stats:", response.status_code, response.text)

```
