# Can you manually curl geoip.elastic.co to get geo data?

**URL:** <https://discuss.elastic.co/t/can-you-manually-curl-geoip-elastic-co-to-get-geo-data/294206>\
**Category:** Elasticsearch\
**Created:** [January 12, 2022, 9:01pm UTC](https://discuss.elastic.co/t/can-you-manually-curl-geoip-elastic-co-to-get-geo-data/294206 "2022-01-12T21:01:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![spuder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spuder/32/44895_2.png) [@spuder](https://discuss.elastic.co/u/spuder)\
**Post date:** [January 12, 2022, 9:01pm UTC](https://discuss.elastic.co/t/can-you-manually-curl-geoip-elastic-co-to-get-geo-data/294206/1 "2022-01-12T21:01:03Z")

</div>

I have an Elasticsearch cluster that does not have internet access for security. According to the documentaiton it is possible to mirror your own geoip endpoint

> **[GeoIP processor | Elasticsearch Guide \[7.16\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/geoip-processor.html#manage-geoip-database-updates)**

I have a mirror setup, however I'm unable to test if the mirror is working because its not clear to me how Elasticsearch downloads the data from [geoip.elastic.co](http://geoip.elastic.co)

I'm attempting something like this using curl

```auto
curl https://geoip.elastic.co/v1/database

```

Which unfortunately just gives me this error

```auto
            <!DOCTYPE html>
            <html lang="en">
            <head>
                <meta charset="utf-8">
                <title>400 Bad Request</title>
            </head>
            <body align="center">
                <div role="main" align="center">
                    <h1>400: Bad Request</h1>
                    <p>The request could not be understood by the server due
                to malformed syntax.</p>
                    <hr />
                </div>
                <div role="contentinfo" align="center">
                    <small>Rocket</small>
                </div>
            </body>
            </html>

```

I'm unable to find API documentation for `geoip.elastic.co`. How can I manually download the data to test if my proxy is working?

---

<div class="post-metadata">

**Author:** ![spuder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spuder/32/44895_2.png) [@spuder](https://discuss.elastic.co/u/spuder)\
**Post date:** [January 12, 2022, 9:45pm UTC](https://discuss.elastic.co/t/can-you-manually-curl-geoip-elastic-co-to-get-geo-data/294206/2 "2022-01-12T21:45:23Z")

</div>

My proxy captured this when pointing Elasticsearch at the mirror

```auto
10.47.65.2 - - [12/Jan/2022:14:19:16 -0700] "GET /geoip_elastic_co/v1/database?key=d1000358-2c34-4c4c-8f4b-REDACTED&elastic_geoip_service_tos=agree HTTP/1.1" 404 74 "-" "Manticore 0.7.1"

```

So a curl request that works is

```auto
curl "https://geoip.elastic.co/v1/database?key=d1000358-2c34-REDACTED&elastic_geoip_service_tos=agree"

```

---

<div class="post-metadata">

**Author:** ![spuder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spuder/32/44895_2.png) [@spuder](https://discuss.elastic.co/u/spuder)\
**Post date:** [January 12, 2022, 10:07pm UTC](https://discuss.elastic.co/t/can-you-manually-curl-geoip-elastic-co-to-get-geo-data/294206/3 "2022-01-12T22:07:15Z")

</div>

Terraform code for mirroring in artifactory

```auto
resource "artifactory_remote_repository" "geoip-elastic-co" {
  key = "geoip-elastic-co-remote"
  package_type = "generic"
  url = "https://geoip.elastic.co"
  repo_layout_ref = "simple-default"
  store_artifacts_locally = false
  propagate_query_params = true
  notes = "managed by terraform"
  content_synchronisation {
    enabled = false
  }
  includes_pattern = "v1/database/*"
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 9, 2022, 10:07pm UTC](https://discuss.elastic.co/t/can-you-manually-curl-geoip-elastic-co-to-get-geo-data/294206/4 "2022-02-09T22:07:52Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
