---
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/4371/api/doc/elasticsearch/v8/operation/operation-ingest-geo-ip-stats
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ingest-geo-ip-stats
products:
  - Elasticsearch
---

# Get GeoIP statistics

Availability: 7.13+

## Paths

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

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#bearerauth)

## Description

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

[Read the reference documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.19/geoip-processor.html)

## Response

`application/json`

- `stats` ({} GeoIpDownloadStatistics)
  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` (DurationValueUnitMillis)
    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 GeoIpNodeDatabases)
  Downloaded GeoIP2 databases for each node.
  Map values ({} GeoIpNodeDatabases)
  - `databases` ([] GeoIpNodeDatabaseName)
    Downloaded databases for the node.
    - `name` (string Name)
      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
```

