Batch JSON endpoint


Batch processing gives you the ability to query multiple IP addresses in one HTTP request.
This is significantly faster than submitting individual queries.


You can call the API by sending HTTP POST requests to http://ip-api.com/batch/

You should supply a valid JSON array, containing up to 100 objects.
HTTP Error 422 will be returned for requests containing more than the beforementioned amount.


Building a request

A request needs to formatted as a JSON array, with objects containing the following

{
    "query": "required, string, IPv4/IPv6",
    "fields": "optional, string/int, fields to return",
    "lang": "optional, string, language for localization"
}

You can also supply default values for fields and lang in the GET parameters. Setting them individually, as shown above, will override the defaults.


Examples

cURL examples
curl ip-api.com/batch --data '[{"query": "208.80.152.201"}, {"query": "91.198.174.192"}]'
curl ip-api.com/batch?fields=isp \ --data '[{"query": "208.80.152.201", "fields": "country"}, {"query": "8.8.8.8"}]'


You can edit this query and experiment with the options

POST
http://ip-api.com/batch

Actual response

Returned data

The API can return the following fields and values

namedescriptionexampletype
statussuccess or failuresuccessstring
messageincluded only when status is failure
Can be one of the following: private range, reserved range, invalid query
invalid querystring
countryCountry nameUnited Statesstring
countryCodeTwo-letter country code ISO 3166-1 alpha-2USstring
regionRegion/state short code (FIPS or ISO)CA or 10string
regionNameRegion/stateCaliforniastring
cityCityMountain Viewstring
zipZip code94043string
latLatitude37.4192float
lonLongitude-122.0574float
timezoneCity timezoneAmerica/Los_Angelesstring
ispISP nameGooglestring
orgOrganization nameGooglestring
asAS number and name, separated by spaceAS15169 Google Inc.string
mobileMobile (cellular) connectiontruebool
proxyProxy (anonymous)truebool
queryIP used for the query173.194.67.94string

Specifying returned data

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)

tick/untick all

generated fields


generated numeric

Localization

Localized city, regionName and country can be requested by setting the GET parameter lang to one of the following:

lang (ISO 639)description
enEnglish (default)
deDeutsch (German)
esEspañol (Spanish)
pt-BREspañol - Argentina (Spanish)
frFrançais (French)
ja日本語 (Japanese)
zh-CN中国 (Chinese)
ruРусский (Russian)

Usage limits

This endpoint is limited to 150 requests per minute from an IP address, and up to 100 queries per HTTP request. If you go over this limit your IP address will be blackholed. You can unban here.

We do not allow commercial use of this endpoint. Please see our pro service for SSL access, unlimited queries and commercial support.