net.info API
v3.6.6Enable location-based experiences, security and analytics with city-level ip geolocation information, including latitude, longitude, time zone, postal code, and more.
Free IP geolocation. No API key is required. Legacy API-key headers are ignored.
Sources and Licenses explains the data providers, attribution requirements, and our work on geo-db.org.
To learn more about this service visit net.info
https://net.info
ip address
{
"ip": "string",
"type": "private",
"location": {
"country": "string",
"region": "string",
"city": "string",
"lat": 0,
"lng": 0,
"postalCode": "string",
"timezone": "string",
"geonameId": 0
}
}
{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid IP Address"
}
{
"statusCode": 404,
"error": "Not Found",
"message": "IP Address not found: ::1"
}
{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Lookup quota exceeded: the request costs 3; retry after 2s"
}
{
"statusCode": 500,
"error": "Internal Server Error",
"message": "Unable to lookup Ip: ::1"
}
{
"statusCode": 503,
"error": "Service Unavailable",
"message": "The lookup quota is unavailable"
}
curl -X GET "https://net.info/ip"
const response = await fetch('https://net.info/ip', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('https://net.info/ip')
data = response.json()
[
"string"
]
{
"data": [
null
]
}
{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid IP Address"
}
{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Lookup quota exceeded: the request costs 3; retry after 2s"
}
{
"statusCode": 503,
"error": "Service Unavailable",
"message": "The lookup quota is unavailable"
}
curl -X POST "https://net.info/ip" \
-H "Content-Type: application/json" \
-d '[ "string"]'
const response = await fetch('https://net.info/ip', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify([ "string"])
});
const data = await response.json();
import requests
response = requests.post(
'https://net.info/ip',
headers={
'Content-Type': 'application/json'
},
json=[ "string"]
)
data = response.json()
| Name | Type | In | Description |
|---|---|---|---|
| ipAddress * | string | path | The IP address. |
{
"ip": "string",
"type": "private",
"location": {
"country": "string",
"region": "string",
"city": "string",
"lat": 0,
"lng": 0,
"postalCode": "string",
"timezone": "string",
"geonameId": 0
}
}
{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid IP Address"
}
{
"statusCode": 404,
"error": "Not Found",
"message": "IP Address not found: ::1"
}
{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Lookup quota exceeded: the request costs 3; retry after 2s"
}
{
"statusCode": 500,
"error": "Internal Server Error",
"message": "Unable to lookup Ip: ::1"
}
{
"statusCode": 503,
"error": "Service Unavailable",
"message": "The lookup quota is unavailable"
}
curl -X GET "https://net.info/ip/{ipAddress}"
const response = await fetch('https://net.info/ip/{ipAddress}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('https://net.info/ip/{ipAddress}')
data = response.json()
speed test
Lightweight endpoint for measuring latency and jitter, at rest and while a transfer loads the link. A failed probe is a failed HTTP request, not a lost packet.
{
"t": 0
}
curl -X GET "https://net.info/speedtest/ping"
const response = await fetch('https://net.info/speedtest/ping', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('https://net.info/speedtest/ping')
data = response.json()
Streams incompressible random data for measuring download throughput.
| Name | Type | In | Description |
|---|---|---|---|
| bytes | integer | query | Number of bytes to stream. |
curl -X GET "https://net.info/speedtest/download?bytes={bytes}"
const response = await fetch('https://net.info/speedtest/download?bytes={bytes}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get(
'https://net.info/speedtest/download',
params={
'bytes': '{bytes}'
}
)
data = response.json()
Accepts and discards an octet-stream body, returning the number of bytes received.
{
"bytes": 0
}
curl -X POST "https://net.info/speedtest/upload"
const response = await fetch('https://net.info/speedtest/upload', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('https://net.info/speedtest/upload')
data = response.json()
Returns the caller's own IP geolocation and ISP/ASN for the speed test UI.
{
"ip": "string",
"type": "private",
"location": {
"country": "string",
"region": "string",
"city": "string",
"lat": 0,
"lng": 0,
"postalCode": "string",
"timezone": "string"
},
"dataVersion": "string",
"confirmations": {
"retentionDays": 0
},
"isp": {
"asn": 0,
"asnOrg": "string"
}
}
curl -X GET "https://net.info/speedtest/whoami"
const response = await fetch('https://net.info/speedtest/whoami', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('https://net.info/speedtest/whoami')
data = response.json()
Records a user-suggested correction to their detected location.
{
"detected": {
"country": "string",
"region": "string",
"city": "string",
"lat": 0,
"lng": 0,
"postalCode": "string"
},
"suggested": {
"country": "string",
"region": "string",
"city": "string",
"lat": 0,
"lng": 0,
"postalCode": "string"
},
"browserLocation": {
"lat": 0,
"lng": 0,
"accuracy": 0
}
}
{
"id": "string",
"status": "string"
}
curl -X POST "https://net.info/speedtest/location-suggestion" \
-H "Content-Type: application/json" \
-d '{ "detected": { "country": "string", "region": "string", "city": "string", "lat": 0, "lng": 0, "postalCode": "string" }, "suggested": { "country": "string", "region": "string", "city": "string", "lat": 0, "lng": 0, "postalCode": "string" }, "browserLocation": { "lat": 0, "lng": 0, "accuracy": 0 }}'
const response = await fetch('https://net.info/speedtest/location-suggestion', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ "detected": { "country": "string", "region": "string", "city": "string", "lat": 0, "lng": 0, "postalCode": "string" }, "suggested": { "country": "string", "region": "string", "city": "string", "lat": 0, "lng": 0, "postalCode": "string" }, "browserLocation": { "lat": 0, "lng": 0, "accuracy": 0 }})
});
const data = await response.json();
import requests
response = requests.post(
'https://net.info/speedtest/location-suggestion',
headers={
'Content-Type': 'application/json'
},
json={ "detected": { "country": "string", "region": "string", "city": "string", "lat": 0, "lng": 0, "postalCode": "string" }, "suggested": { "country": "string", "region": "string", "city": "string", "lat": 0, "lng": 0, "postalCode": "string" }, "browserLocation": { "lat": 0, "lng": 0, "accuracy": 0 }}
)
data = response.json()
Records that the location detected for the caller's address is right. The service detects the location again and records it with the version of the data it came from, keeping the record for the number of days whoami reports. If that location or data version no longer matches the one confirmed, nothing is recorded and the answer is 409. While confirmations are not recorded, the answer is 404.
{
"id": "string",
"dataVersion": "string",
"purposeVersion": "string",
"detected": {
"country": "string",
"region": "string",
"city": "string"
},
"browserLocation": {
"lat": 0,
"lng": 0,
"accuracy": 0
}
}
{
"id": "string",
"status": "string"
}
curl -X POST "https://net.info/speedtest/location-confirmation" \
-H "Content-Type: application/json" \
-d '{ "id": "string", "dataVersion": "string", "purposeVersion": "string", "detected": { "country": "string", "region": "string", "city": "string" }, "browserLocation": { "lat": 0, "lng": 0, "accuracy": 0 }}'
const response = await fetch('https://net.info/speedtest/location-confirmation', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ "id": "string", "dataVersion": "string", "purposeVersion": "string", "detected": { "country": "string", "region": "string", "city": "string" }, "browserLocation": { "lat": 0, "lng": 0, "accuracy": 0 }})
});
const data = await response.json();
import requests
response = requests.post(
'https://net.info/speedtest/location-confirmation',
headers={
'Content-Type': 'application/json'
},
json={ "id": "string", "dataVersion": "string", "purposeVersion": "string", "detected": { "country": "string", "region": "string", "city": "string" }, "browserLocation": { "lat": 0, "lng": 0, "accuracy": 0 }}
)
data = response.json()