Quick Start
Get up and running with IPFly in minutes. Make your first request with the example below.
{
"ip": "8.8.8.8",
"hostname": "dns.google",
"country_code2": "US",
"country_name": "United States",
"state_prov": "California",
"city": "Mountain View",
"latitude": "37.4056",
"longitude": "-122.0775",
"is_eu": false,
"country_emoji": "πΊπΈ",
"calling_code": "+1",
"asn": { "asn": "AS15169", "name": "Google LLC", "type": "hosting" },
"currency": { "code": "USD", "symbol": "$" },
"security": { "is_tor": false, "is_proxy": false, "is_vpn": false, "is_cloud_provider": true },
"time_zone": { "name": "America/New_York", "offset": -4, "is_dst": true }
}Authentication
All requests require your API token as a query parameter. You can query your own IP by omitting the ip parameter.
Detect your own IP automatically:
Look up a specific IP address:
Get your API token by signing up for a free account. Keep your token secure and never expose it in client-side code.
Making Requests
All requests are simple HTTP GET calls. No special headers required.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | Yes | Your API authentication token |
ip | string | No | IP address to lookup (IPv4 or IPv6). Omit to detect caller's IP. |
Standalone Fields
Root-level fields returned for every lookup.
| Field | Type | Description | Status |
|---|---|---|---|
ip | string | The queried IP address. | Required |
hostname | string | Reverse DNS hostname of the IP. | Required |
country_code2 | string | ISO 3166-1 alpha-2 country code. | Required |
country_code3 | string | ISO 3166-1 alpha-3 country code. | Required |
country_name | string | Common name of the country. | Required |
country_capital | string | Capital city of the country. | Required |
country_emoji | string | Country flag emoji. | Required |
calling_code | string | International dialing code. | Required |
country_tld | string | Country code top-level domain (e.g. .ua). | Required |
languages | string | Official languages of the country. | Required |
is_eu | boolean | Whether the country is an EU member. | Required |
Location Object
Detailed geographic data for the IP address.
| Field | Type | Description | Status |
|---|---|---|---|
state_prov | string | State / province / region name. | Optional |
state_code | string | State/province code. | Optional |
district | string | District or sub-region. | Optional |
city | string | City name. | Optional |
zipcode | string | ZIP / postal code. | Optional |
latitude | string | Latitude coordinate. | Required |
longitude | string | Longitude coordinate. | Required |
ASN Object
Autonomous System Number information.
| Field | Type | Description |
|---|---|---|
asn.asn | string | AS number (e.g. AS15169). |
asn.name | string | Organization name. |
asn.domain | string | Organization's domain. |
asn.route | string | IP route/prefix (CIDR notation). |
asn.type | string | Network type: isp, hosting, business, education. |
Timezone Object
Current time and timezone data for the IP's location.
| Field | Type | Description |
|---|---|---|
time_zone.name | string | IANA timezone name (e.g. Europe/Paris). |
time_zone.offset | number | UTC offset in hours (without DST). |
time_zone.offset_with_dst | number | UTC offset including DST. |
time_zone.current_time | string | Current local time string. |
time_zone.current_time_unix | number | Current time as Unix timestamp. |
time_zone.current_tz_abbreviation | string | Timezone abbreviation (e.g. EEST). |
time_zone.is_dst | boolean | Whether DST is currently active. |
Security Object
Threat intelligence and anonymization detection flags.
| Field | Type | Description |
|---|---|---|
security.is_tor | boolean | Whether the IP is a Tor exit node. |
security.is_proxy | boolean | Whether the IP is a known proxy. |
security.is_vpn | boolean | Whether the IP belongs to a VPN service. |
security.is_relay | boolean | Whether the IP is a relay node. |
security.is_cloud_provider | boolean | Whether the IP is from a cloud provider. |
security.proxy_type | string | Type of proxy detected, or "N/A". |
Currency Object
Local currency information for the IP's country.
| Field | Type | Description |
|---|---|---|
currency.code | string | ISO 4217 currency code (e.g. UAH). |
currency.name | string | Currency name (e.g. Hryvnia). |
currency.symbol | string | Currency symbol (e.g. β΄). |
cURL
curl "https://ipfly.world/api?token=YOUR_TOKEN" curl "https://ipfly.world/api?token=YOUR_TOKEN&ip=8.8.8.8"
JavaScript
const res = await fetch('https://ipfly.world/api?token=YOUR_TOKEN');
const data = await res.json();
console.log(data.country_name); // "Poland"
console.log(data.city); // "Warsaw"
console.log(data.security.is_vpn); // false
console.log(data.currency.symbol); // "zl"PHP
<?php $url = 'https://ipfly.world/api?token=YOUR_TOKEN&ip=8.8.8.8'; $data = json_decode(file_get_contents($url), true); echo $data['country_name']; // "United States" echo $data['security']['is_vpn']; // false
Python
import requests
r = requests.get("https://ipfly.world/api", params={"token": "YOUR_TOKEN"})
data = r.json()
print(data["city"]) # Tokyo
print(data["asn"]["name"]) # Google JapanJava
import java.net.URI;
import java.net.http.*;
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create("https://ipfly.world/api?token=YOUR_TOKEN"))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Ruby
require 'net/http'
require 'json'
uri = URI("https://ipfly.world/api?token=YOUR_TOKEN")
data = JSON.parse(Net::HTTP.get(uri))
puts data["country_name"]
puts data["security"]["is_vpn"]