IP Lookup
Get the country name and country code of an IP address (and maybe some other information).
No api key is required! Yay 🎉
Usage
To get your IP address, just send a GET request to the following endpoint:
curl -X GET "https://api.jm26.net/ip-lookup/"
The response will be:
{
"status": "success",
"message": "Results found",
"data": {
"ipAddress": "0000:0000:0000:0000:0000:0000:0000:0000",
"countryName": "United States",
"countryCode": "US"
}
}
Parameters
The following parameters are available:
Parameter | Description | Default | Required |
---|---|---|---|
ip | The IP address to get the information for | - | ✖️ |
format* | The format of the response (json or text) | json | ✖️ |
advanced | Whether to include advanced information (true or false) | false | ✖️ |
*The format
parameter does not support the advanced response.
Advanced Information
If you include the advanced
parameter and set it to true
, you will receive the following additional information:
{
"status": "success",
"message": "Results found",
"data": {
"ipVersion": 4,
"ipAddress": "1.1.1.1",
"latitude": 37.33939,
"longitude": -121.894958,
"countryName": "United States of America",
"countryCode": "US",
"timeZone": "-08:00",
"zipCode": "95101",
"cityName": "San Jose",
"regionName": "California",
"countryInfo": {
"country_code": "US",
"capital": "Washington, D.C.",
"total_area": "9826675"
}
}
}
Please note: The advanced
response may not always be very accurate, because it is based on a free IP lookup service. If you need more accurate information, you should use a paid service.
Demo
We have a demo available at https://api.jm26.net/ip-lookup/demo/. Just visit the page and you will see the results for your IP address.
More Examples
Get Information for a Specific IP Address
curl -X GET "https://api.jm26.net/ip-lookup/?ip=1.1.1.1"
{
"status": "success",
"message": "Results found",
"data": {
"ipAddress": "1.1.1.1",
"countryName": "United States",
"countryCode": "US"
}
}
Get Information in Text Format
curl -X GET "https://api.jm26.net/ip-lookup/?ip=1.1.1.1&format=text"
United States (US)
License
This site uses the IP2Location LITE database for IP geolocation
Do not expect too accurate results from this demo using the advanced mode, as it uses the LITE database