Pricing Documentation Contact Status
Log in Get Free API Key →

API Reference

Complete reference for integrating IP geolocation and threat intelligence into your applications.

Quick Start

Get up and running with IPFly in minutes. Make your first request with the example below.

GET https://ipfly.world/api?token=YOUR_TOKEN&ip=8.8.8.8
json β€” Example Response
{
  "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:

GEThttps://ipfly.world/api?token=YOUR_TOKEN

Look up a specific IP address:

GEThttps://ipfly.world/api?token=YOUR_TOKEN&ip=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

ParameterTypeRequiredDescription
tokenstringYesYour API authentication token
ipstringNoIP address to lookup (IPv4 or IPv6). Omit to detect caller's IP.

Standalone Fields

Root-level fields returned for every lookup.

FieldTypeDescriptionStatus
ipstringThe queried IP address.Required
hostnamestringReverse DNS hostname of the IP.Required
country_code2stringISO 3166-1 alpha-2 country code.Required
country_code3stringISO 3166-1 alpha-3 country code.Required
country_namestringCommon name of the country.Required
country_capitalstringCapital city of the country.Required
country_emojistringCountry flag emoji.Required
calling_codestringInternational dialing code.Required
country_tldstringCountry code top-level domain (e.g. .ua).Required
languagesstringOfficial languages of the country.Required
is_eubooleanWhether the country is an EU member.Required

Location Object

Detailed geographic data for the IP address.

FieldTypeDescriptionStatus
state_provstringState / province / region name.Optional
state_codestringState/province code.Optional
districtstringDistrict or sub-region.Optional
citystringCity name.Optional
zipcodestringZIP / postal code.Optional
latitudestringLatitude coordinate.Required
longitudestringLongitude coordinate.Required

ASN Object

Autonomous System Number information.

FieldTypeDescription
asn.asnstringAS number (e.g. AS15169).
asn.namestringOrganization name.
asn.domainstringOrganization's domain.
asn.routestringIP route/prefix (CIDR notation).
asn.typestringNetwork type: isp, hosting, business, education.

Timezone Object

Current time and timezone data for the IP's location.

FieldTypeDescription
time_zone.namestringIANA timezone name (e.g. Europe/Paris).
time_zone.offsetnumberUTC offset in hours (without DST).
time_zone.offset_with_dstnumberUTC offset including DST.
time_zone.current_timestringCurrent local time string.
time_zone.current_time_unixnumberCurrent time as Unix timestamp.
time_zone.current_tz_abbreviationstringTimezone abbreviation (e.g. EEST).
time_zone.is_dstbooleanWhether DST is currently active.

Security Object

Threat intelligence and anonymization detection flags.

FieldTypeDescription
security.is_torbooleanWhether the IP is a Tor exit node.
security.is_proxybooleanWhether the IP is a known proxy.
security.is_vpnbooleanWhether the IP belongs to a VPN service.
security.is_relaybooleanWhether the IP is a relay node.
security.is_cloud_providerbooleanWhether the IP is from a cloud provider.
security.proxy_typestringType of proxy detected, or "N/A".

Currency Object

Local currency information for the IP's country.

FieldTypeDescription
currency.codestringISO 4217 currency code (e.g. UAH).
currency.namestringCurrency name (e.g. Hryvnia).
currency.symbolstringCurrency symbol (e.g. β‚΄).

cURL

bash
curl "https://ipfly.world/api?token=YOUR_TOKEN"
curl "https://ipfly.world/api?token=YOUR_TOKEN&ip=8.8.8.8"

JavaScript

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
<?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

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 Japan

Java

java
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

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"]

Build on reliable IP Intelligence

Start with 1,000 free requests per day. No credit card. No commitments. Scale when you’re ready.