The country, region, city, time zone, position and internet provider of an IPv4 or IPv6 address. Free: 1,000 requests a day, counted from midnight to midnight in Malawi. Without a limit: subscribe for MWK 2,000 a month in the dashboard, under Dev Tools. A month runs from the day you pay to the same day of the next month.
https://telcomw.com/api/ip/8.8.8.8Put the IP address in the URL. Your API key goes in the X-API-Key header (or ?api_key= in the address).
| Parameter | Sent in | Required | Description |
X-API-Key |
header | YES | Your API key, sent as a header. You can also send it as Authorization: Bearer YOUR_API_KEY, or, because this is a GET, as the api_key parameter in the address. |
api_key |
query | NO | Your API key in the address, instead of the header. A key in an address can be kept in logs, so prefer the header. |
ip_address |
path | YES | The IPv4 or IPv6 address to look up, for example 8.8.8.8. |
curl --location --request GET 'https://telcomw.com/api/ip/8.8.8.8' \ --header 'X-API-Key: YOUR_API_KEY'
curl --location --request GET "https://telcomw.com/api/ip/8.8.8.8" ^ --header "X-API-Key: YOUR_API_KEY"
<?php
$headers = [
'X-API-Key: YOUR_API_KEY',
];
$ch = curl_init('https://telcomw.com/api/ip/8.8.8.8');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
print_r(json_decode($response, true));
const axios = require('axios');
axios.request({
method: 'get',
url: 'https://telcomw.com/api/ip/8.8.8.8',
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
}).then((res) => console.log(res.data))
.catch((err) => console.error(err.response ? err.response.data : err.message));
import requests
headers = {
'X-API-Key': 'YOUR_API_KEY'
}
response = requests.request('GET', 'https://telcomw.com/api/ip/8.8.8.8', headers=headers)
print(response.json())
The response is JSON.
{
"success": true,
"request_id": "req_5f2c9a1d0e7b4a63",
"data": {
"ip": "8.8.8.8",
"country_code": "US",
"country": "United States",
"is_eu": false,
"region": "",
"city": "",
"timezone": "America/Chicago",
"latitude": 37.751,
"longitude": -97.822,
"accuracy_radius_km": 1000,
"network_provider": {
"name": "GOOGLE - Google LLC",
"asn": 15169
}
}
}
{
"success": false,
"request_id": "req_5f2c9a1d0e7b4a63",
"error": {
"code": "INVALID_IP",
"message": "That is not an IPv4 or IPv6 address. Use /api/ip/8.8.8.8"
}
}
{
"success": false,
"request_id": "req_5f2c9a1d0e7b4a63",
"error": {
"code": "IP_NOT_FOUND",
"message": "There is no location for that address (it is private, reserved or unknown)."
}
}
{
"success": false,
"request_id": "req_5f2c9a1d0e7b4a63",
"error": {
"code": "DAILY_LIMIT_REACHED",
"message": "The free plan allows 1,000 requests a day and today's are used. It starts again at midnight (Malawi time)."
}
}
| Field | Description |
data.ip | The address that was looked up. |
data.country_code | The 2 letter country code, for example MW. |
data.country | The name of the country. |
data.is_eu | true when the country is in the European Union. |
data.region | The region or state, when it is known (it can be empty). |
data.city | The city, when it is known (it can be empty). |
data.timezone | The time zone, for example Africa/Blantyre. |
data.latitude | The latitude of the place. |
data.longitude | The longitude of the place. |
data.network_provider | The internet provider (network) that owns the address: its name and its AS number, for example AIRTEL-MW Airtel Malawi. It is null when the provider is not known. |
data.accuracy_radius_km | About how far, in kilometres, the real place can be from the position given. |
X-RateLimit-Limit | Response header: the requests you can make a day (1,000), or unlimited when you have a subscription. |
X-RateLimit-Remaining | Response header: the requests left today. |
X-Plan | Response header: free or subscribed. |