IP Address Location and Operator Lookup API Reference
IP Allocation API conforms to the design principles of the REST. It accepts both GET and POST HTTP Requests with parameters, and returns HTTP Responses in JSON format or multi-line text.
The IP Allocation API only accepts requests for a single ip address.
To reduce the amount of processing required by the client application - to extract only the information that is need - the Request can have an optional filter parameter, to limit the fields returned in the Response.
Response formatting is controlled by a format Request parameter.
We do support both HTTPS and plain text HTTP API requests. When speed is preferred over encrypted communication with ipzoomer.com servers, HTTP request - response trip time can take under 20 milliseconds, depending of your network latency.
Even when your network latency is low (with minimal delay), the HTTPS communication will take an additional 30 milliseconds to establish the SSL connection.
With a Connection: keep-alive request header, all subsequent requests should take less than 20 millisecond.
curl https://api.ipzoomer.com/v1/ip/209.141.34.134
# or simply
curl http://api.ipzoomer.com/v1/209.141.34.134
A GET Request can include the IP value to be looked up at the end of the path.
/ip/ token in the path is optional when the IP value follows the version /v1/ token, and no other parameters are sent.
Currently, the API Client is not required to get and send an API Key.
API Request with ip Parameter
The ip parameter indicates what record the API Client wants to lookup. The parameter is optional as the IP value can be added to the Request url as the last token on the path.
Lookup IP value can be passed as a parameter in a GET or POST Request, or added to the URL.
If no ip parameter or url path token value is sent, the API will lookup the Client IP address when path ends with /self/, similarly to a "what is my ip address" request.
# a POST Request
curl https://api.ipzoomer.com/v1/ \
-H 'Connection: keep-alive' \
-d ip=209.141.34.134
# a GET Request
curl "http://api.ipzoomer.com/v1/?ip=209.141.34.134"
# "what is my ip address" - no ip parameter
curl http://api.ipzoomer.com/v1/self/
{
"ip": "209.141.34.134",
"ip_block": "209.141.32.0/19",
"ip_block_start": "209.141.32.0",
"ip_block_end": "209.141.63.255",
"ip_block_size": "8192",
"type": "ipv4",
"network_type": "DCH",
"asn": 53667,
"provider": "PONYNET",
"continent_code": "NA",
"country_code": "US",
"country_name": "USA",
"country_flag": "http://api.ipzoomer.com/static/flag/US.png",
"region_name": "Nevada",
"city": "Las Vegas",
"zip": "89119",
"latitude": 36.102,
"longitude": -115.1447,
"risk_code": "TORE",
"risk_name": "Tor Exit Node",
"risk_score": 70,
"query": "209.141.34.134"
}
API Request with filter Parameter
The filter parameter can be used to reduce the fields returned in the Response. For multiple fields the API Client should use a comma character separator, with no spaces around it.
You may use fields parameter in place of filter, it it easier to remember for you.
# a POST Request
curl https://api.ipzoomer.com/v1/ \
-d ip=209.141.34.134 \
-d filter=country_code,country_flag
# a GET Request
curl "http://api.ipzoomer.com/v1/?ip=209.141.34.134&filter=country_code,country_flag"
{
"country_code": "US",
"country_flag": "http://api.ipzoomer.com/static/flag/US.png"
}
API Request with format Parameter jsonp
The format parameter indicates whether the API Client expects the Response in JSON, TAB Text or multi-line text.
The default value for format is one line JSON. When the API Client is expecting to get the response for multi-line printing, including indentation - the parameter format value must be set as json-pretty, json-print or shorter as jsonp.
# a POST Request
curl https://api.ipzoomer.com/v1/ \
-d ip=209.141.34.134 \
-d filter=country_code,location \
-d format=jsonp
# a GET Request
curl "http://api.ipzoomer.com/v1/?ip=209.141.34.134&filter=country_code,location&format=jsonp"
{
"country_code": "US",
"latitude": 36.102,
"longitude": -115.1447
}
API Request with format Parameter TAB
The format parameter value tab indicates the API Client expects the Response in TAB multi-line Text formatting.
Each line in the Response contains the filed name, a TAB character separator and the field value.
# a POST Request
curl https://api.ipzoomer.com/v1/ \
-d ip=209.141.34.134 \
-d filter=country_code,location \
-d format=tab
# a GET Request
curl https://api.ipzoomer.com/v1/?ip=209.141.34.134&filter=country_code,location&format=tab
country_code US latitude 36.102 longitude -115.1447
API Request with comma format
The format parameter value comma indicates the API Client expects the Response in comma separated values formatting.
The single line in the Response contains only the field values separated by a comma character.
# a POST Request
curl https://api.ipzoomer.com/v1/ \
-d ip=209.141.34.134 \
-d filter=continent,country,region,city \
-d format=comma
# a GET Request
curl "http://api.ipzoomer.com/v1/?ip=209.141.34.134&filter=continent,country,region,city&format=comma"
NA,US,Nevada,Las Vegas
API Request with filter Parameter text
The format parameter value text indicates the API Client expects the Response in multi-line Text formatting.
Each line in the Response contains only the field value.
This formating is handy when the API Client expects just one value, for example the country code where the IP address originates from. The field country is a shortcut for the country_code field.
# a POST Request
curl https://api.ipzoomer.com/v1/ \
-d ip=209.141.34.134 \
-d filter=country \
-d format=text
# a GET Request
curl "http://api.ipzoomer.com/v1/?ip=209.141.34.134&filter=country&format=text"
US