The API base path ishttp://ip-api.com/xml/{query}
{query}
can be a single IPv4/IPv6 address or a domain name. If you don't supply a query the current IP address will be used.
Parameters
Query parameters (such as custom fields) are appended as GET request parameters, for example:http://ip-api.com/xml/?fields=61439
fields | response fields optional |
lang | response language optional |
There is no API key required.
Quick test
You can edit this query and experiment with the options
Returned data
The API can return the following fields and values
If you don't require all the returned fields, use the GET parameter fields
to specify which data should be returned.
Separate the fields by comma (fields=status,message,query,country,city
) or use a generated, numeric value (to save bandwidth)
Localization
Localized city, regionName and country can be requested by setting the GET parameter lang
to one of the following:
lang (ISO 639) | description |
---|---|
en | English (default) |
de | Deutsch (German) |
es | Español (Spanish) |
pt-BR | Português - Brasil (Portuguese) |
fr | Français (French) |
ja | 日本語 (Japanese) |
zh-CN | 中国 (Chinese) |
ru | Русский (Russian) |
SSL (HTTPS)
256-bit SSL encryption is not available for this free API. Please see our pro service.
Usage limits
This endpoint is limited to 45 requests per minute from an IP address.
If you go over the limit your requests will be throttled (HTTP 429
) until your rate limit window is reset. If you constantly go over the limit your IP address will be banned for 1 hour.
The returned HTTP header X-Rl
contains the number of requests remaining in the current rate limit window. X-Ttl
contains the seconds until the limit is reset.
Your implementation should always check the value of the X-Rl
header, and if its is 0 you must not send any more requests for the duration of X-Ttl
in seconds.
We do not allow commercial use of this endpoint. Please see our pro service for SSL access, unlimited queries and commercial support.