IPFly API Documentation

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

Quick Start

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

GET https://ipfly.world/api?token=YOUR_TOKEN&ip=8.8.8.8
// Example Response { "ip": "1.1.1.1", "hostname": "one.one.one.one", "continent_code": "OC", "continent_name": "Oceania", "country_code2": "AU", "country_code3": "AUS", "country_name": "Australia", "country_name_official": "Commonwealth of Australia", "country_capital": "Canberra", "state_prov": "Queensland", "state_code": "AU-QLD", "district": "South Brisbane", "city": "Brisbane", "zipcode": "4101", "latitude": "-27.47306", "longitude": "153.01421", "is_eu": false, "geoname_id": "10113228", "country_emoji": "🇦🇺", "calling_code": "+61", "country_tld": ".au", "languages": "en-AU", "isp": "APNIC Research and Development", "connection_type": "", "organization": "Cloudflare, Inc.", "asn": "AS13335", "currency": { "code": "AUD", "name": "Australian Dollar", "symbol": "A$" }, "time_zone": { "name": "Australia/Brisbane", "offset": 10, "offset_with_dst": 10, "current_time": "2025-10-06 21:11:17.757+1000", "current_time_unix": 1759749077.757, "current_tz_abbreviation": "AEST", "current_tz_full_name": "Australian Eastern Standard Time", "standard_tz_abbreviation": "AEST", "standard_tz_full_name": "Australian Eastern Standard Time", "is_dst": false, "dst_savings": 0, "dst_exists": false, "dst_tz_abbreviation": "", "dst_tz_full_name": "", "dst_start": "", "dst_end": "" }, "security": { "threat_score": 5, "is_tor": false, "is_proxy": false, "proxy_type": "", "is_anonymous": false, "is_known_attacker": false, "is_spam": false, "is_bot": false, "is_cloud_provider": true } }

Authentication

All API requests require authentication using your API token. Include it as a query parameter in your requests. You can query your IP address without entering it. This will return information about your current IP and connection.

Request to obtain currently connected IPv4/IPv6 of your client:

GET https://ipfly.world/api?token=YOUR_TOKEN

Request to obtain information from specified IPv4/IPv6:

GET https://ipfly.world/api?token=YOUR_TOKEN&ip=IP_ADDRESS

Request to obtain information from hostname or domain name:

GET https://ipfly.world/api?token=YOUR_TOKEN&ip=youtube.com

You can get your API token by signing up for a free account. The token should be kept secure and not shared publicly.

Making Requests

Make HTTP GET requests to our API endpoint with the required parameters.

Parameters

Parameter Type Required Description
token string Yes Your API authentication token
ip string No IP address to lookup (IPv4 or IPv6)

Standalone Fields Reference

These fields are returned at the root level of the API response and contain core information about the IP address being queried.

Field Type Description Required
ip string IP address that is used to lookup geolocation information. Required
domain string Domain name that is used to lookup geolocation information. It is not returned if an IP address is used to query ipfly API. Optional
hostname string Hostname of the IP address used to query ipfly API. Required
geoname_id string Unique identifier from GeoNames geographical database. Required
country_emoji string Flag emoji representing the country of the IP address. Required
calling_code string International calling code for the country. Required
country_tld string Country code top-level domain (e.g., .au for Australia). Required
languages string Official languages spoken in the country. Required
isp string Internet Service Provider associated with the IP address. Required
connection_type string Type of internet connection (e.g., broadband, cellular). Optional
organization string Organization that owns the IP address range. Required
asn string Autonomous System Number associated with the IP. Required

Location Object Reference

Detailed geographic information about the IP address location including continent, country, and city-level data.

Field Type Description Required
continent_code string 2-letter code of the continent (e.g., OC for Oceania). Required
continent_name string Full name of the continent. Required
country_code2 string Country code (ISO 3166-1 alpha-2) of the country. Required
country_code3 string Country code (ISO 3166-1 alpha-3) of the country. Required
country_name string Common name of the country. Required
country_name_official string Official name (ISO 3166) of the country. Required
country_capital string Capital city of the country. Required
state_prov string Name of the state/province/region. Optional
state_code string Code of the state/province/region. Optional
district string Name of the district or county. Optional
city string Name of the city. Optional
zipcode string ZIP/Postal code of the location. Optional
latitude string Latitude coordinate of the location. Required
longitude string Longitude coordinate of the location. Required
is_eu boolean Indicates if the country belongs to the European Union. Required

Currency Object Reference

Information about the official currency used in the country of the IP address.

Field Type Description Required
currency.code string 3-letter currency code (ISO 4217). Required
currency.name string Full name of the currency. Required
currency.symbol string Currency symbol used in the country. Required

Time Zone Object Reference

Comprehensive time zone information including current time, offsets, and daylight saving details.

Field Type Description Required
time_zone.name string IANA time zone name (e.g., "Australia/Brisbane"). Required
time_zone.offset integer UTC offset in hours. Required
time_zone.offset_with_dst integer UTC offset including daylight saving time. Required
time_zone.current_time string Current local time in ISO format. Required
time_zone.current_time_unix float Current local time as Unix timestamp. Required
time_zone.current_tz_abbreviation string Current time zone abbreviation. Required
time_zone.current_tz_full_name string Current time zone full name. Required
time_zone.standard_tz_abbreviation string Standard time zone abbreviation (without DST). Required
time_zone.standard_tz_full_name string Standard time zone full name (without DST). Required
time_zone.is_dst boolean Indicates if daylight saving time is currently active. Required
time_zone.dst_savings integer Daylight saving time offset in hours. Required
time_zone.dst_exists boolean Indicates if the location observes daylight saving time. Required
time_zone.dst_tz_abbreviation string Daylight saving time zone abbreviation. Optional
time_zone.dst_tz_full_name string Daylight saving time zone full name. Optional
time_zone.dst_start string Date and time when daylight saving time starts. Optional
time_zone.dst_end string Date and time when daylight saving time ends. Optional

Security Object Reference

Security assessment and threat intelligence data for the IP address.

Field Type Description Required
security.threat_score integer Overall threat score from 0 (low risk) to 100 (high risk). Required
security.is_tor boolean Indicates if the IP is a Tor exit node. Required
security.is_proxy boolean Indicates if the IP is a proxy server. Required
security.proxy_type string Type of proxy if applicable (e.g., VPN, web proxy). Optional
security.is_anonymous boolean Indicates if the IP provides anonymity services. Required
security.is_known_attacker boolean Indicates if the IP is associated with known attacks. Required
security.is_spam boolean Indicates if the IP is associated with spam activities. Required
security.is_bot boolean Indicates if the IP is associated with bot activities. Required
security.is_cloud_provider boolean Indicates if the IP belongs to a cloud provider. Required

Code Examples

Integrate IPFly API into your application with these code examples.

JavaScript
PHP
Python
Java
Ruby
cURL
// Using Fetch API async function lookupIP(ip) { const token = 'YOUR_API_TOKEN'; const response = await fetch(`https://ipfly.world/api?token=${token}&ip=${ip}`); const data = await response.json(); return data; } // Example usage lookupIP('8.8.8.8') .then(data => console.log(data)) .catch(error => console.error('Error:', error)); // Using jQuery $.ajax({ url: 'https://ipfly.world/api', method: 'GET', data: { token: 'YOUR_API_TOKEN', ip: '8.8.8.8' }, success: function(data) { console.log(data); }, error: function(xhr, status, error) { console.error('Error:', error); } });
<?php // Using cURL function lookupIP($ip) { $token = 'YOUR_API_TOKEN'; $url = "https://ipfly.world/api?token=$token&ip=$ip"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); curl_close($ch); return json_decode($response, true); } // Example usage $data = lookupIP('8.8.8.8'); print_r($data); // Using file_get_contents (if allow_url_fopen is enabled) function lookupIPSimple($ip) { $token = 'YOUR_API_TOKEN'; $url = "https://ipfly.world/api?token=$token&ip=$ip"; $response = file_get_contents($url); return json_decode($response, true); } ?>
import requests def lookup_ip(ip_address): token = 'YOUR_API_TOKEN' url = f'https://ipfly.world/api?token={token}&ip={ip_address}' try: response = requests.get(url) response.raise_for_status() # Raises an HTTPError for bad responses return response.json() except requests.exceptions.RequestException as e: print(f"Error: {e}") return None # Example usage data = lookup_ip('8.8.8.8') print(data) # Alternative using urllib import urllib.request import json def lookup_ip_urllib(ip_address): token = 'YOUR_API_TOKEN' url = f'https://ipfly.world/api?token={token}&ip={ip_address}' with urllib.request.urlopen(url) as response: data = json.loads(response.read().decode()) return data
import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import com.google.gson.JsonObject; import com.google.gson.JsonParser; public class IPLookup { public static JsonObject lookupIP(String ipAddress) { try { String token = "YOUR_API_TOKEN"; String urlString = "https://ipfly.world/api?token=" + token + "&ip=" + ipAddress; URL url = new URL(urlString); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); BufferedReader in = new BufferedReader( new InputStreamReader(conn.getInputStream())); String inputLine; StringBuilder content = new StringBuilder(); while ((inputLine = in.readLine()) != null) { content.append(inputLine); } in.close(); conn.disconnect(); return JsonParser.parseString(content.toString()).getAsJsonObject(); } catch (Exception e) { e.printStackTrace(); return null; } } // Example usage public static void main(String[] args) { JsonObject data = lookupIP("8.8.8.8"); System.out.println(data); } }
require 'net/http' require 'json' def lookup_ip(ip_address) token = 'YOUR_API_TOKEN' url = "https://ipfly.world/api?token=#{token}&ip=#{ip_address}" uri = URI(url) response = Net::HTTP.get(uri) JSON.parse(response) end # Example usage data = lookup_ip('8.8.8.8') puts data # Alternative using the 'net/http' with error handling def lookup_ip_with_error_handling(ip_address) token = 'YOUR_API_TOKEN' url = "https://ipfly.world/api?token=#{token}&ip=#{ip_address}" begin uri = URI(url) response = Net::HTTP.get(uri) JSON.parse(response) rescue => e puts "Error: #{e.message}" nil end end
# Basic cURL request curl -X GET "https://ipfly.world/api?token=YOUR_API_TOKEN&ip=8.8.8.8" # Save response to file curl -X GET "https://ipfly.world/api?token=YOUR_API_TOKEN&ip=8.8.8.8" -o response.json # Pretty print JSON response (requires jq) curl -s -X GET "https://ipfly.world/api?token=YOUR_API_TOKEN&ip=8.8.8.8" | jq '.' # With custom headers curl -X GET \ -H "Accept: application/json" \ "https://ipfly.world/api?token=YOUR_API_TOKEN&ip=8.8.8.8" # Using environment variable for token export IPFLY_TOKEN="YOUR_API_TOKEN" curl -X GET "https://ipfly.world/api?token=$IPFLY_TOKEN&ip=8.8.8.8"