Skip to content

Commit 3cf2161

Browse files
authored
Merge pull request #1284 from maxmind/luna/exchange-docs
GeoIP Exchange reports can be downloaded
2 parents c16c2de + 4d59f27 commit 3cf2161

File tree

3 files changed

+179
-39
lines changed

3 files changed

+179
-39
lines changed

content/geoip/geoip-exchange.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
draft: false
3+
title: GeoIP Exchange documentation
4+
---
5+
6+
## Overview
7+
8+
GeoIP Exchange is a platform for network operators to receive automated feedback
9+
about how MaxMind codes their networks. To learn more and join, please
10+
[sign up on our website](https://www.maxmind.com/en/geoip-exchange).
11+
12+
## Download GeoIP Exchange geofeed report
13+
14+
If you are a current GeoIP Exchange user, you can automate downloads of the
15+
GeoIP Exchange geofeed report. In order to download the report from a script or
16+
program, please use the permalinks found on the GeoIP Exchange page on your
17+
account portal.
18+
19+
Please note that you will be redirected from these permalinks to the hostname
20+
`storage.googleapis.com`.
21+
22+
### Download best practices
23+
24+
At a high-level, the best practice is to write an automated script that
25+
periodically checks the `last-modified` header for the report's build date, and
26+
downloads the resulting report when the `last-modified` time is later than the
27+
`last-modified` time of the latest local copy of the report.
28+
29+
It is good to check periodically throughout the day for a new report so that you
30+
do not rely on an update schedule, and so that you catch off-schedule reports.
31+
32+
### Checking for the latest release date
33+
34+
You can check the date of the GeoIP Exchange geofeed report's latest release by
35+
issuing a HEAD request for that report's download permalink URL. The download
36+
permalink can be found in the GeoIP Exchange section of your account portal.
37+
38+
The basic steps are:
39+
40+
1. In the “Report links” row for the geofeed, click “Get Permalinks”.
41+
2. Copy the permalink provided in the modal window.
42+
3. Provide your
43+
[account ID](https://support.maxmind.com/hc/en-us/articles/4412951066779-Find-my-Account-ID)
44+
and
45+
[your license key](https://www.maxmind.com/en/accounts/current/license-key)
46+
using
47+
[Basic Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication)
48+
to authenticate.
49+
4. If you are using `wget` or `curl` from a shell script, please be sure to
50+
quote the URL.
51+
52+
For example, you can issue a `curl` command like the following:
53+
54+
```bash
55+
curl -I -L -u YOUR_ACCOUNT_ID:YOUR_LICENSE_KEY \
56+
'https://download.maxmind.com/geofeed/reports/v1.0/YOUR_GEOFEED_ID/YOUR_REPORT_ID'
57+
```
58+
59+
Or a `wget` command like the following:
60+
61+
```bash
62+
wget -S \
63+
--method HEAD \
64+
--user=YOUR_ACCOUNT_ID \
65+
--password=YOUR_LICENSE_KEY \
66+
'https://download.maxmind.com/geofeed/reports/v1.0/YOUR_GEOFEED_ID/YOUR_REPORT_ID'
67+
```
68+
69+
Where `YOUR_ACCOUNT_ID` is a placeholder for your account ID and
70+
`YOUR_LICENSE_KEY` is a placeholder for your license key.
71+
[Learn more about license keys on our knowledge base](https://support.maxmind.com/hc/en-us/articles/4407116112539-Using-License-Keys).
72+
Please note that the permalink copied from your account portal will replace
73+
`YOUR_GEOFEED_ID` with a unique ID for your geofeed and `YOUR_REPORT_ID` with an
74+
identifier for the kind of report you're downloading.
75+
76+
In the response, you can check the `last-modified` header for the file’s build
77+
date. These checks can be incorporated into your own script or program,
78+
according to your needs.
79+
80+
### Automating downloads
81+
82+
The steps for automating downloads of the report are similar to the steps for
83+
checking the latest release date. Instead of checking the file HEAD, you will
84+
download the file.
85+
86+
1. In the “Report links” row for the geofeed, click “Get Permalinks”.
87+
2. Copy the permalink provided in the modal window.
88+
3. Provide your
89+
[account ID](https://support.maxmind.com/hc/en-us/articles/4412951066779-Find-my-Account-ID)
90+
and
91+
[your license key](https://www.maxmind.com/en/accounts/current/license-key)
92+
using
93+
[Basic Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication)
94+
to authenticate.
95+
4. If you are using `wget` or `curl` from a shell script, please be sure to
96+
quote the URL.
97+
98+
For example, you can issue a `curl` command like the following:
99+
100+
```shell
101+
curl -O -J -L -u YOUR_ACCOUNT_ID:YOUR_LICENSE_KEY 'https://download.maxmind.com/geofeed/reports/v1.0/YOUR_GEOFEED_ID/YOUR_REPORT_ID'
102+
```
103+
104+
Or a `wget` command like the following:
105+
106+
```shell
107+
wget --user=YOUR_ACCOUNT_ID --password=YOUR_LICENSE_KEY 'https://download.maxmind.com/geofeed/reports/v1.0/YOUR_GEOFEED_ID/YOUR_REPORT_ID'
108+
```
109+
110+
Where `YOUR_ACCOUNT_ID` is a placeholder for your account ID and
111+
`YOUR_LICENSE_KEY` is a placeholder for your license key.
112+
[Learn more about license keys on our knowledge base](https://support.maxmind.com/hc/en-us/articles/4407116112539-Using-License-Keys).
113+
Please note that the permalink copied from your account portal will replace
114+
`YOUR_GEOFEED_ID` with a unique ID for your geofeed and `YOUR_REPORT_ID` with an
115+
identifier for the kind of report you're downloading.
116+
117+
This will save the database to a file called `YOUR_REPORT_ID.csv`. For example,
118+
`https://download.maxmind.com/geofeed/reports/v1.0/YOUR_GEOFEED_ID/geolocation`
119+
would download a file called `geolocation.csv`.

content/geoip/updating-databases.md

Lines changed: 55 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,61 @@ servers can make HTTPS connections to the following hostname:
134134
This is only recommended for systems unable to use GeoIP Update or for clients
135135
using the CSV-format databases.
136136

137+
### Download best practices
138+
139+
At a high-level, the best practice is to write an automated script that
140+
periodically checks the `last-modified` header for the database's build date,
141+
and downloads the database when the `last-modified` time is later than the
142+
`last-modified` time of the latest local copy of the database.
143+
144+
It is good to check periodically throughout the day for a release so that you do
145+
not rely on an update schedule, and so that you catch off-schedule releases.
146+
147+
### Checking for the Latest Release Date
148+
149+
You can check the date of a given database’s latest release by issuing a HEAD
150+
request for that database’s download permalink URL. The download permalink can
151+
be found in the
152+
[Download Databases](https://www.maxmind.com/en/accounts/current/geoip/downloads)
153+
section of your account portal.
154+
155+
For example, using the permalink for the GeoIP2 City CSV database, you can issue
156+
a `curl` command like the following:
157+
158+
```bash
159+
curl -I -L -u YOUR_ACCOUNT_ID:YOUR_LICENSE_KEY \
160+
'https://download.maxmind.com/geoip/databases/GeoIP2-City-CSV/download?suffix=zip'
161+
```
162+
163+
Or a `wget` command like the following:
164+
165+
```bash
166+
wget -S \
167+
--method HEAD \
168+
--user=YOUR_ACCOUNT_ID \
169+
--password=YOUR_LICENSE_KEY \
170+
'https://download.maxmind.com/geoip/databases/GeoIP2-City-CSV/download?suffix=zip'
171+
```
172+
173+
Where `YOUR_ACCOUNT_ID` is a placeholder for your account ID and
174+
`YOUR_LICENSE_KEY` is a placeholder for your license key.
175+
[Learn more about license keys on our knowledge base](https://support.maxmind.com/hc/en-us/articles/4407116112539-Using-License-Keys).
176+
177+
In the response, you can check the `last-modified` header for the file’s build
178+
date, or you can check the `content-disposition` header for the date that would
179+
appear in the file name. These checks can be incorporated into your own script
180+
or program, according to your needs.
181+
182+
This method only issues a HEAD request, rather than a download request, so
183+
running this check won’t count against your
184+
[daily database download limit](https://support.maxmind.com/hc/en-us/articles/4408216129947).
185+
186+
### Automating downloads
187+
188+
The steps for automating downloads of the databases are similar to the steps for
189+
checking the latest release date. Instead of checking the file HEAD, you will
190+
download the file.
191+
137192
In order to download the databases from a script or program, please use the
138193
permalinks found on the
139194
[GeoIP download page](https://www.maxmind.com/en/accounts/current/geoip/downloads).
@@ -190,45 +245,6 @@ documentation pages (see
190245
and
191246
[tutorials for importing CSV databases into SQL](/geoip/importing-databases).
192247

193-
### Checking for the Latest Release Date
194-
195-
You can check the date of a given database’s latest release by issuing a HEAD
196-
request for that database’s download permalink URL. The download permalink can
197-
be found in the
198-
[Download Databases](https://www.maxmind.com/en/accounts/current/geoip/downloads)
199-
section of your account portal.
200-
201-
For example, using the permalink for the GeoIP2 City CSV database, you can issue
202-
a `curl` command like the following:
203-
204-
```bash
205-
curl -I -L -u YOUR_ACCOUNT_ID:YOUR_LICENSE_KEY \
206-
'https://download.maxmind.com/geoip/databases/GeoIP2-City-CSV/download?suffix=zip'
207-
```
208-
209-
Or a `wget` command like the following:
210-
211-
```bash
212-
wget -S \
213-
--method HEAD \
214-
--user=YOUR_ACCOUNT_ID \
215-
--password=YOUR_LICENSE_KEY \
216-
'https://download.maxmind.com/geoip/databases/GeoIP2-City-CSV/download?suffix=zip'
217-
```
218-
219-
Where `YOUR_ACCOUNT_ID` is a placeholder for your account ID and
220-
`YOUR_LICENSE_KEY` is a placeholder for your license key.
221-
[Learn more about license keys on our knowledge base](https://support.maxmind.com/hc/en-us/articles/4407116112539-Using-License-Keys).
222-
223-
In the response, you can check the `last-modified` header for the file’s build
224-
date, or you can check the `content-disposition` header for the date that would
225-
appear in the file name. These checks can be incorporated into your own script
226-
or program, according to your needs.
227-
228-
This method only issues a HEAD request, rather than a download request, so
229-
running this check won’t count against your
230-
[daily database download limit](https://support.maxmind.com/hc/en-us/articles/4408216129947).
231-
232248
## Changes to file size between updates
233249

234250
It is expected for database files to increase or decrease in size from time to

hugo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ title = 'MaxMind'
206206
pageRef = '/geoip/geolite2-free-geolocation-data'
207207
parent = 'GeoIP'
208208
weight = 80
209+
[[menus.geoip]]
210+
name = 'GeoIP Exchange'
211+
pageRef = '/geoip/geoip-exchange'
212+
parent = 'GeoIP'
213+
weight = 85
209214
[[menus.geoip]]
210215
name = 'Privacy Exclusions API'
211216
pageRef = '/geoip/privacy-exclusions-api'

0 commit comments

Comments
 (0)