Options
Specify Output Format
Using the IPstack API's output parameter the API result format can be switched between JSON (default) and XML. Set the output parameter to json or xml depending on your preference.
To see the API response, navigate to the API Response section.
Specify Response Fields
To save bandwidth and speed up response times, the IPstack API's fields parameter can be used to limit API results to a certain object or set of objects.
This parameter is supported by all 3 API endpoints. To use this feature, append the fields parameter to your API request URL and specify one of the following options:
Example Request:
Setting the fields object to country_code causes the IPstack API to return only the country_code object.
Sign Up to Run API Request
Example Response:
Important: Please note that modules not supported by your subscription plan (e.g. time_zone on the Free Plan) will cause error 301 to be returned by the API. The same error will be shown when trying to access the Security Module without having set &security=1 in the API request.
Specify Response Language
The IPstack API is capable of delivering its result set in different languages. To request data in a language other than English (default), append the API's language parameter to your API request URL and set it to one of the supported 2-letter language codes.
Supported languages:
en- English/USde- Germanes- Spanishfr- Frenchja- Japanesept-br- Portugues (Brazil)ru- Russianzh- Chinese
Example Request: In the following example request, the language is set to de for German.
Sign Up to Run API Request
Example Response: The API now responds in German.
Please note that certain objects may not be subject to translation.
Enable Security Module
Customers subscribed to the Professional Plus Plan may access the IPstack API's Security Module, which can be used to assess risks and threats originating from certain IP addresses before any harm can be done to a website or web application.
In order to use this feature, append the API's security parameter and set it to 1.
Example Request:
Sign Up to Run API Request
Example Response: If the Security Module is supported by your subscription plan, the API response will now contain a security object. For illustration purposes the IP address 103.3.61.114, which is known to be used by the Tor system, has been used for this example API request.
To learn more about each security response object, please refer to the Response Objects section.
Enable Hostname Lookup
By default, the IPstack API does not return information about the hostname the given IP address resolves to. In order to include the hostname object in your API result, append the API's hostname parameter and set it to 1.
Example Request:
Sign Up to Run API Request
Example Response: If Hostname Lookup is enabled, the API response will now come with a hostname object containing the given hostname value.
Important: Hostname Lookup is disabled by default to reduce bandwidth. Please note that enabling Hostname Lookup may increase API response times.