canonical: https://jentic.com/apis/country.is/country-is

# Country Is Country

Jentic publishes the only available OpenAPI specification for Country, keeping it validated and agent-ready. country.is is a free, no-auth IP-to-country lookup service exposed as a small REST API with four endpoints: a caller-IP lookup, a path-based single-IP lookup, a batch POST endpoint, and a service info route. It returns just the ISO 3166-1 alpha-2 country code for an IP address - nothing else - which makes it ideal for lightweight geolocation routing, fraud filtering, or compliance gating without standing up a paid geolocation account.

## For AI agents

Look up the country for one or many IP addresses with no authentication required. Returns the ISO 3166-1 alpha-2 country code per IP.

## Scope

Does not return city, region, ISP, or timezone - use for IP-to-country code lookup only.

## Capabilities

- Look up the calling client's country by IP with a single GET request
- Resolve a specific IPv4 or IPv6 address to its ISO country code
- Batch-resolve up to a list of IP addresses in one POST
- Retrieve service info such as version and dataset metadata
- Embed lightweight country detection in edge or serverless workloads
- Gate features or content on the visitor's country without paid geolocation

## Use cases

### Visitor Country Detection

Resolve a visitor's country from their IP address to localise content, currency, or feature flags. country.is needs no API key and returns just an ISO alpha-2 code, which keeps payloads small and latency low. Suitable for edge functions and serverless handlers that want country awareness without paying for a full geolocation provider.

Example prompt: Call GET / from the user's request context and read the `country` field from the JSON response

### Compliance Country Gating

Enforce geographic restrictions for regulated content, embargoed regions, or per-region features by checking the IP's country code before serving a request. Use the path-based lookup when the IP comes from an upstream proxy header rather than the direct caller. Returns only the country code, so downstream code stays simple.

Example prompt: Read the X-Forwarded-For header, call GET /{ip}, and reject the request if the country code is in a configured embargo list

### Bulk IP Triage

Score a backlog of suspicious IPs (server logs, abuse reports, signup forms) by country in a single POST. The batch endpoint accepts a list of IPs and returns the country code for each, so a fraud or security workflow can attach country context to every record without sending one request per IP.

Example prompt: Submit a list of 100 suspicious IPs to POST / and tag each log line with the resolved country code

### AI Agent Geo-Context

Give an AI agent country awareness when it processes web requests, support tickets, or signup events. Through Jentic, the agent searches for 'look up country from IP' and gets a structured operation it can call without any credential setup. Because country.is is auth-free, the integration is essentially zero-config.

Example prompt: Use Jentic to search 'look up country from IP', load the schema for GET /{ip}, and execute it with the user-supplied IP

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/` | Look up the caller's country |
| GET | `/{ip}` | Look up a specific IP |
| POST | `/` | Batch lookup of multiple IPs |
| GET | `/info` | Service info and dataset version |

## Key resources

- **Caller Lookup** — Resolve the country of the request's source IP via GET /
- **IP Lookup** — Resolve any IPv4 or IPv6 address to a country code via GET /{ip}
- **Batch Lookup** — Resolve a list of IPs in one POST request
- **Service Info** — Inspect dataset version and service metadata via GET /info

## Why Jentic

- **Setup:** Wiring Country.is by hand means coding your own requests against its api.country.is host for IP-to-country lookups. Through Jentic you install once, import Country.is from the API Directory, and your agent calls it.
- **Permission scoping:** Country.is is a read-only IP lookup where the IP is a value in the path, not a permissionable resource, so scope by operation: limit the agent to the operations it needs, such as looking up the country for an IP address. You choose the operations it may call, so it stays limited to that lookup.
- **Credential handling:** Country.is takes no credential to call; Jentic still runs it through your own Jentic One instance so nothing sensitive enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'find the country for this IP address', and Jentic returns the matching Country.is operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **ipapi** — Paid IP geolocation with city, region, ISP, and timezone fields
- **ipstack** — Commercial IP geolocation with security and proxy detection
- **ipgeolocation.io** — Geolocation, timezone, and ASN lookups in one call
- **Countrylayer API** — Looks up rich country metadata once you have the country code

## FAQ

### Why is there no official OpenAPI spec for Country?

country.is does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Country via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the country.is API use?

country.is requires no authentication. All four endpoints are public and return a JSON object containing only the ISO 3166-1 alpha-2 country code. When called via Jentic, no credential is provisioned for this API.

### Can I look up a specific IP address with country.is?

Yes. Send GET /{ip} with the IPv4 or IPv6 address as the path parameter. The response is `{"ip": "...", "country": "US"}`. For multiple addresses in a single request, POST a JSON list of IPs to /.

### What are the rate limits for country.is?

country.is does not publish a hard rate limit, but the service is run as a free public utility and aggressive use will be throttled at the network layer. For high-volume workloads, cache the country code per IP and consider falling back to a paid provider.

### How do I integrate country.is with an AI agent through Jentic?

Search Jentic for 'look up country from IP', load the schema for GET /{ip}, and execute it with the IP you want to resolve. Because country.is needs no auth, the only thing Jentic returns is the response payload.

### Does country.is return city or region information?

No. country.is intentionally returns only the country code. For city, region, or ISP-level enrichment, use a richer geolocation API like ipinfo, ipstack, or ipgeolocation.io.

### Can I limit what my agent is allowed to do with the country.is API?

Yes. Because you run Jentic One yourself, your own rules decide which country.is operations the agent may call, and country.is is a read-only IP lookup where the IP is just a path value rather than a permissionable resource, so you scope it by operation. You can allow only the operations the agent actually needs, such as resolving the caller's country with GET / or looking up a specific IPv4 or IPv6 address with GET /{ip}, while withholding the batch POST / or the GET /info service route. Since the API takes no credential, the operations you grant are the only control surface, and the agent stays limited to exactly those lookups.
