---
type: api
title: Get GeoIP statistics
description: Get download statistics for GeoIP2 databases that are used with the GeoIP processor.
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/elasticsearch/v9/operation/operation-ingest-geo-ip-stats
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/elasticsearch/v9/operation/operation-ingest-geo-ip-stats
products:
  - Elasticsearch
---

# Get GeoIP statistics

Authentication: required

Availability: Generally available since 7.13

## Paths

- `GET` `/_ingest/geoip/stats`

## Description

Get download statistics for GeoIP2 databases that are used with the GeoIP processor.

[More about the GeoIP processor](https://www.elastic.co/docs/reference/enrich-processor/geoip-processor)

## Response

`application/json`

- `stats` (object)
  Download statistics for all GeoIP2 databases.
  - `successful_downloads` (number)
    Total number of successful database downloads.
  - `failed_downloads` (number)
    Total number of failed database downloads.
  - `total_download_time` (number)
    Total milliseconds spent downloading databases.
  - `databases_count` (number)
    Current number of databases available for use.
  - `skipped_updates` (number)
    Total number of database updates skipped.
  - `expired_databases` (number)
    Total number of databases not updated after 30 days
- `nodes` (map string to object)
  Downloaded GeoIP2 databases for each node.
  Map values (object)
  - `databases` (object[])
    Downloaded databases for the node.
    - `name` (string)
      Name of the database.
  - `files_in_temp` (string[])
    Downloaded database files, including related license files. Elasticsearch stores these files in the node’s temporary directory: $ES_TMPDIR/geoip-databases/<node_id>.
## Code examples

#### Console

```console
GET _ingest/geoip/stats
```

#### JavaScript

```javascript
const response = await client.ingest.geoIpStats();
```

#### Python

```python
resp = client.ingest.geo_ip_stats()
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_ingest/geoip/stats" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.ingest().geoIpStats();
```

#### C#

```c#
var response = await client.Ingest.GeoIpStatsAsync();
```

#### PHP

```php
$resp = $client->ingest()->geoIpStats();
```

#### Ruby

```ruby
response = client.ingest.geo_ip_stats
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "stats": {
    "successful_downloads": 0,
    "failed_downloads": 0,
    "total_download_time": 0,
    "databases_count": 0,
    "skipped_updates": 0,
    "expired_databases": 0
  },
  "nodes": {
    "key": {
      "databases": [
        {
          "name": "string"
        }
      ],
      "files_in_temp": [
        "string"
      ]
    }
  }
}
```

