# Free IP-to-Country Geolocation API | Country

> Markdown mirror of DialtoneApp's public top-site detail page for `country.is`.

URL: https://dialtoneapp.com/top-sites/country.is/index.md
Canonical HTML: https://dialtoneapp.com/top-sites/country.is

## Summary

- Domain: `country.is`
- Website: https://country.is
- Description: callable surface | score 30 | purchase read only
- Label: callable_surface
- Payment surface: Not available
- Purchase boundary: read_only
- Control boundary: unknown
- Rank: 16077

## robots

~~~text
User-agent: *
Allow: /

Sitemap: https://country.is/sitemap.xml
~~~

## llms

~~~text
# Country

> Country is a free IP geolocation API. Given an IP address, it returns the corresponding ISO 3166-1 alpha-2 country code. Optionally, it can return extra fields such as city, continent, subdivision, postal code, location coordinates, and ASN. No API key is required.

The API is hosted at https://api.country.is and is free for all use cases, including commercial. It rate-limits to 10 requests per second per IP. Data is sourced from MaxMind GeoLite2 and Cloudflare, updated every 24 hours.

## API Endpoints

- [GET /](https://api.country.is/): Returns `{"ip": "...", "country": "XX"}` for the requesting IP
- [GET /{ip}](https://api.country.is/8.8.8.8): Returns `{"ip": "8.8.8.8", "country": "US"}` for a given IPv4 or IPv6 address
- [POST /](https://api.country.is/): Batch lookup — send a JSON array of up to 100 IPs
- [GET /info](https://api.country.is/info): Returns `{"version": "...", "dataSources": [...], "lastUpdated": "..."}` metadata

## Extra Fields

Add `?fields=city,asn` (or any combination) to any lookup endpoint. Available fields: city, continent, subdivision, postal, location, asn.

## Errors

- `400` — Invalid IP address or malformed request
- `404` — No data found for the given IP
- `429` — Rate limit exceeded

## Self-Hosting

- [Docker image](https://hub.docker.com/r/lineofflight/country): Run `docker run -d -p 3000:3000 -e ACCOUNT_ID=... -e LICENSE_KEY=... lineofflight/country`
- [Source code](https://github.com/lineofflight/country): GitHub repository

## Optional

- [OpenAPI spec](https://api.country.is/openapi.json): Machine-readable API specification
- [Website](https://country.is): Full documentation and quick answers
~~~

## llms-full

Not found.