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

# Get GeoIP statistics

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.

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

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/guide/en/elasticsearch/reference/current/token-authentication-services.html)

## 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
```

