Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support country-level locations #3

Open
hombit opened this issue Apr 12, 2022 · 3 comments
Open

Support country-level locations #3

hombit opened this issue Apr 12, 2022 · 3 comments

Comments

@hombit
Copy link
Owner

hombit commented Apr 12, 2022

No description provided.

@abdullahdevrel
Copy link

I am the devrel of IPinfo. Would you like to check out our free full accuracy IP to Country database for this project? The database is licensed under CC-BY-SA 4.0 and is updated daily.

Field Name Example Description
start_ip 217.220.0.0 Starting IP address of an IP address range
end_ip 217.223.255.255 Ending IP address of an IP address range
country IT ISO 3166 country code of the location
country_name Italy Name of the country
continent EU Continent code of the country
continent_name Europe Name of the continent

We also have a free country + ASN database if you are interested.

@hombit
Copy link
Owner Author

hombit commented Jul 14, 2023

@abdullahdevrel since it is available in MMDB format, it should be simple to use it instead of the Maxmind DB, I added the link to the Readme.

The more interesting thing is daily updates: is there an URL geo302 can use to update the database automatically?

@abdullahdevrel
Copy link

@hombit Thank you very much!

The more interesting thing is daily updates: is there an URL geo302 can use to update the database automatically?

Yes. Direct downloads:

Filetype API endpoint
CSV https://ipinfo.io/data/free/country.csv.gz?token=<YOUR_TOKEN>
JSON https://ipinfo.io/data/free/country.json.gz?token=<YOUR_TOKEN>
MMDB https://ipinfo.io/data/free/country.mmdb?token=<YOUR_TOKEN>

Some notes:

  • API endpoints work with a token that can be availed by opening a free account.
  • The MMDB file is not gzipped.
  • The data structure of the MMDB database is flat and tabular.
  • Rate limit is 3 downloads per token, per unique IP address, per day. Users can use download the database across multiple devices using the same token.
  • We also have a checksums endpoint: https://ipinfo.io/data/free/country.mmdb/checksums?token=<YOUR_TOKEN>

You can use our mmdbtcl CLI to lookup IP addresses from the MMDB file like so:

ipinfo ► mmdbctl read 62.166.144.88 country.mmdb -f json-pretty
{
  "continent": "EU",
  "continent_name": "Europe",
  "country": "NL",
  "country_name": "Netherlands"
}

Please let me know if you have any feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants