-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51b4d83
commit 7c8aa57
Showing
5 changed files
with
132 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,111 +1,86 @@ | ||
--- | ||
layout: compress | ||
layout: default | ||
title: IP-to-Country Geolocation API | ||
--- | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta | ||
name="description" | ||
content="Free, open-source IP-to-country geolocation API that finds and returns a user’s country based on their IPv4/IPv6 address" | ||
/> | ||
<link rel="canonical" href="https://country.is/" /> | ||
<title>IP-to-Country Geolocation API | Country.is</title> | ||
<script | ||
defer | ||
src="https://kit.fontawesome.com/d12ab438e8.js" | ||
crossorigin="anonymous" | ||
></script> | ||
<script defer src="javascripts/application.js"></script> | ||
<link rel="stylesheet" href="https://fonts.xz.style/serve/inter.css" /> | ||
<link rel="stylesheet" href="styles/application.css" /> | ||
</head> | ||
<body> | ||
<header> | ||
<i class="fa-sharp-duotone fa-solid fa-earth-americas fa-3x"></i> | ||
<h1>Country</h1> | ||
<a href="https://github.com/hakanensari/country">GitHub</a> / | ||
<a href="https://hub.docker.com/r/hakanensari/country">Docker</a> | ||
<p> | ||
Country is an IP-to-country geolocation API that returns a user’s | ||
country based on their IP address. | ||
</p> | ||
<p> | ||
We offer a <a href="https://api.country.is">free instance</a>—no API key | ||
needed. You can also self-host if preferred. | ||
</p> | ||
</header> | ||
<h2>Usage</h2> | ||
<p>The API has a minimal interface.</p> | ||
<dl> | ||
<dt>GET /</dt> | ||
<dd> | ||
Returns the country of the IP making the request, typically the user’s | ||
browser or app. | ||
</dd> | ||
<dd> | ||
<pre><code data-url="https://api.country.is/"></code></pre> | ||
</dd> | ||
<dt>GET /{ip}</dt> | ||
<dd> | ||
Returns the country of any given IP. The API supports both with IPv4 and | ||
IPv6. | ||
</dd> | ||
<dd> | ||
<pre><code data-url="https://api.country.is/77.1.2.3"></code></pre> | ||
</dd> | ||
<dt>GET /info</dt> | ||
<dd> | ||
Provides metadata about the API, including when the data sources were | ||
last updated. | ||
</dd> | ||
<dd> | ||
<pre><code data-url="https://api.country.is/info"></code></pre> | ||
</dd> | ||
</dl> | ||
<header> | ||
<i class="fa-sharp-duotone fa-solid fa-earth-americas fa-3x"></i> | ||
<h1>Country</h1> | ||
<a href="https://github.com/hakanensari/country">GitHub</a> / | ||
<a href="https://hub.docker.com/r/hakanensari/country">Docker</a> | ||
<p> | ||
Country is an IP-to-country geolocation API that returns a user’s country | ||
based on their IP address. | ||
</p> | ||
<p> | ||
We run a <a href="https://api.country.is">free instance</a>—no API key | ||
needed. You can also self-host if preferred. | ||
</p> | ||
</header> | ||
<h2>Usage</h2> | ||
<p>The API has a minimal interface.</p> | ||
<dl> | ||
<dt>GET /</dt> | ||
<dd> | ||
Returns the country of the IP making the request, typically the user’s | ||
browser or app. | ||
</dd> | ||
<dd> | ||
<pre><code data-url="https://api.country.is/"></code></pre> | ||
</dd> | ||
<dt>GET /{ip}</dt> | ||
<dd> | ||
Returns the country of any given IP. The API supports both with IPv4 and | ||
IPv6. | ||
</dd> | ||
<dd> | ||
<pre><code data-url="https://api.country.is/77.1.2.3"></code></pre> | ||
</dd> | ||
<dt>GET /info</dt> | ||
<dd> | ||
Provides metadata about the API, including when the data sources were last | ||
updated. | ||
</dd> | ||
<dd> | ||
<pre><code data-url="https://api.country.is/info"></code></pre> | ||
</dd> | ||
<dd> | ||
The API automatically updates MaxMind data every 24 hours in the background. | ||
</dd> | ||
</dl> | ||
|
||
<p> | ||
The API automatically updates MaxMind data every 24 hours in the | ||
background. | ||
</p> | ||
<h2>Deployment</h2> | ||
<p> | ||
If you prefer not to use our hosted service, you can self-host with Docker. | ||
</p> | ||
<pre><code>docker run -d -p 3000:3000 -e ACCOUNT_ID=YOUR_MAXMIND_ACCOUNT_ID -e LICENSE_KEY=YOUR_MAXMIND_LICENSE_KEY hakanensari/country</code></pre> | ||
<p> | ||
Replace <code>YOUR_MAXMIND_ACCOUNT_ID</code> and | ||
<code>YOUR_LICENSE_KEY</code> with your MaxMind account ID and the | ||
<a href="https://www.maxmind.com/en/geolite2/signup" | ||
>license key associated with it</a | ||
>. | ||
</p> | ||
|
||
<h2>Deployment</h2> | ||
<p> | ||
If you prefer not to use our hosted service, you can self-host with | ||
Docker. | ||
</p> | ||
<pre><code>{% include docker.sh %}</code></pre> | ||
<p> | ||
Replace <code>YOUR_MAXMIND_ACCOUNT_ID</code> and | ||
<code>YOUR_LICENSE_KEY</code> with your MaxMind account ID and the | ||
<a href="https://www.maxmind.com/en/geolite2/signup" | ||
>license key associated with it</a | ||
>. | ||
</p> | ||
|
||
<h2>Notes</h2> | ||
<ul> | ||
<li> | ||
The API uses geolocation data provided by | ||
<a href="https://www.maxmind.com">MaxMind</a> and optionally | ||
<a | ||
href="https://support.cloudflare.com/hc/en-us/articles/200168236-Configuring-IP-geolocation" | ||
>Cloudfare</a | ||
>. | ||
</li> | ||
<li> | ||
Since 30 December 2019, you need to register for a | ||
<a href="https://www.maxmind.com/en/geolite2/signup">license key</a> to | ||
download the MaxMind data if you're self-hosting. | ||
</li> | ||
<li> | ||
Our public instance rate-limits queries from the same IP at 10 requests | ||
per second. If you need to make more requests server-side, consider | ||
self-hosting or querying the MaxMind data directly. | ||
</li> | ||
<li>The API does not log any requests.</li> | ||
</ul> | ||
</body> | ||
</html> | ||
<h2>Notes</h2> | ||
<ul> | ||
<li> | ||
The API uses geolocation data provided by | ||
<a href="https://www.maxmind.com">MaxMind</a> and optionally | ||
<a | ||
href="https://support.cloudflare.com/hc/en-us/articles/200168236-Configuring-IP-geolocation" | ||
>Cloudfare</a | ||
>. | ||
</li> | ||
<li> | ||
Since 30 December 2019, you need to register for a | ||
<a href="https://www.maxmind.com/en/geolite2/signup">license key</a> to | ||
download the MaxMind data if you're self-hosting. | ||
</li> | ||
<li> | ||
Our public instance rate-limits queries from the same IP at 10 requests per | ||
second. If you need to make more requests server-side, consider self-hosting | ||
or querying the MaxMind data directly. | ||
</li> | ||
<li>The API does not log any requests.</li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters