IPstack
Status: Live
The IPstack API offers a powerful, real-time IP to geolocation API capable of looking up accurate location data and assessing security threats originating from risky IP addresses. Results are delivered within milliseconds in JSON or XML format. Using the IPstack API you will be able to locate website visitors at first glance and adjust your user experience and application accordingly.
IPstack API Details
The IPstack API provides a comprehensive solution for IP address geolocation and security assessment. Below are the key features and business rules associated with the API:
Key Features
- Real-time Geolocation: The API allows for real-time lookups of IP addresses to determine their geographical location.
- Security Insights: It assesses security threats by identifying risky IP addresses, enabling businesses to take necessary precautions.
- Multiple Data Formats: Results can be returned in JSON or XML format, catering to different integration needs.
- Speed: The API delivers results within milliseconds, ensuring a seamless user experience.
- Customizable Responses: Users can specify which fields to return in the response to optimize bandwidth and speed.
Business Rules
- Access Key Requirement: Each API request must include a valid access key for authentication. Requests without a valid key will be denied.
- Rate Limiting: The API enforces rate limits based on the subscription plan. Exceeding these limits will result in temporary access restrictions.
- Field Specification: Users can specify which fields to include in the response. If no fields are specified, the default set of fields will be returned.
- Hostname Lookup: Users can enable hostname lookup by setting the appropriate parameter. This feature is optional and can be toggled on or off.
- Security Insights: Advanced security insights can be enabled, providing additional information about the IP address, such as proxy detection and threat levels.
- Bulk Lookups: The API supports bulk lookups for multiple IP addresses, allowing users to retrieve data for up to 50 addresses in a single request.
- Data Accuracy: The API aims to provide accurate and up-to-date information, but users should be aware that geolocation data may vary based on the IP address's nature and the underlying infrastructure.
- Compliance: Users must comply with all applicable laws and regulations when using the API, particularly regarding data privacy and security.
IPstack API Examples
1. Standard IP Lookup
GET https://api.apilayer.net/ipstack/{ip_address}?access_key=YOUR_ACCESS_KEYExample Request:
GET https://api.apilayer.net/ipstack/134.201.250.155?access_key=YOUR_ACCESS_KEYExample Response:
{
"ip": "134.201.250.155",
"type": "ipv4",
"continent_code": "NA",
"continent_name": "North America",
"country_code": "US",
"country_name": "United States",
"region_code": "CA",
"region_name": "California",
"city": "Los Angeles",
"zip": "90013",
"latitude": 34.0655,
"longitude": -118.2405,
"location": {},
"time_zone": {},
"currency": {},
"connection": {}
}2. Requester IP Lookup
GET https://api.apilayer.net/ipstack/check?access_key=YOUR_ACCESS_KEYExample Request:
GET https://api.apilayer.net/ipstack/check?access_key=YOUR_ACCESS_KEYExample Response:
{
"ip": "203.0.113.25",
"type": "ipv4",
"continent_code": "AS",
"continent_name": "Asia",
"country_code": "IN",
"country_name": "India",
"region_code": "DL",
"region_name": "Delhi",
"city": "New Delhi",
"zip": "110001",
"latitude": 28.6139,
"longitude": 77.2090,
"location": {},
"time_zone": {},
"currency": {},
"connection": {}
}3. Bulk IP Lookup
GET https://api.apilayer.net/ipstack/{ip_addresses}?access_key=YOUR_ACCESS_KEYExample Request:
GET https://api.apilayer.net/ipstack/134.201.250.155,72.229.28.185?access_key=YOUR_ACCESS_KEYExample Response:
[
{
"ip": "134.201.250.155",
"type": "ipv4",
"continent_code": "NA",
"continent_name": "North America",
"country_code": "US",
"country_name": "United States",
"region_code": "CA",
"region_name": "California",
"city": "Los Angeles",
"zip": "90013",
"latitude": 34.0655,
"longitude": -118.2405,
"location": {},
"time_zone": {},
"currency": {},
"connection": {}
},
{
"ip": "72.229.28.185",
"type": "ipv4",
"continent_code": "NA",
"continent_name": "North America",
"country_code": "US",
"country_name": "United States",
"region_code": "NY",
"region_name": "New York",
"city": "New York",
"zip": "10036",
"latitude": 40.7605,
"longitude": -73.9933,
"location": {},
"time_zone": {},
"currency": {},
"connection": {}
}
]