API Freaks logoAPI Freaks logo
CTRL+K

    APIs

  • Pricing
  • Resources
  • Tools

  • Contact us
CTRL+K
Sign InGet Started For Free
  • Overview
  • Documentation
  • How to Guides
  • Pricing
  • APIFreaks
  • Organization and Teams
  • Credits Usage API
  • IP Geolocation Lookup
  • Bulk IP Geolocation Lookup
  • Domain WHOIS Lookup
  • IP WHOIS Lookup
  • ASN Lookup
  • Domain WHOIS Historical Lookup
  • Domain WHOIS Reverse Lookup
  • Bulk Domain WHOIS Lookup
  • DNS Lookup
  • Historical DNS Lookup
  • Reverse DNS Lookup
  • Bulk DNS Lookup
  • SSL Certificate Lookup
  • Domain Availability
  • Bulk Domain Availability API
  • Website Screenshot
  • Bulk Screenshot
  • Currencies Exchange Rates
  • Currency Converter
  • Currency Time Series
  • Currency Fluctuation
  • Geolocalized Currency Converter
  • Live Commodity Prices
  • Commodity Historical Prices
  • Commodity Fluctuation
  • Commodity Time Series
  • Timezone Lookup
  • Timezone Converter
  • Zipcode Lookup
  • Email Checker
  • User Agent Parser
  • Bulk User Agent Parser
  • Astronomy API

IP Location API - Accurate Geolocation for IP Addresses

This IP to location API allows you to track IP address locations with precision, providing detailed information such as country, region, city, coordinates, postal code, and timezone. Perfect for enhancing user insights and improving geographic analysis.

Our API simplifies the process to geolocate IP addresses with ease. By integrating our service, you gain valuable insights that support data-driven strategies and improve operational efficiency. Whether you are analyzing user behavior, managing network infrastructure, or planning geographically targeted campaigns, our IP Geolocation API offers reliable and precise location data to meet your needs.

10K Free Credits, No Credit Card Required

Features

Multilingual Support

Geolocation lookup supports response in multiple languages including English, German, Russian, Japanese, French, Chinese, Czech and Italian.

Response Filtration

Specify what you want in query parameter and get only those fields. This will save you processing time, bandwidth and improve the API response time.

IP Security Information

Get the IP Security data along with the geolocation information.

IP Hostname Lookup

Hostname lookup can also be provided with the gelocation lookup via 3 different ways.

User-agent Information

Parse the user-agent string of a device with the geolocation lookup.

IP Abuse Contact Information

Get the IP Abuse contact information with the geolocation lookup

IP DMA Information

Get the IP DMA information with the geolocation lookup.

Time Zone Information

Get the Time Zone information with the geolocation lookup.

Documentation

API Endpoint

GET

https://api.apifreaks.com/v1.0/geolocation/lookup

Test
LANGUAGE
Python
PHP
Java
Node
Ruby
JavaScript
C#
$ pip install requests

API Request

ParameterRequiredTypeDefaultDescription
ipNoString-IPv4, IPv6, or hostname whose geolocation lookup is required
langNoStringenResponse language. Possible values are: (1) en (English) (2) de (German) (3) ru (Russian) (4) ja (Japanese) (5) fr (French) (6) cn (Chinese Simplifed) (7) es (Spanish) (8) cs (Czech) (9) it (Italian)
fieldsNoString-Comma separated list of fields to be included in the response. For example, `location` includes all location fields, `location.city` is a specific field. See the response fields section for more details.
excludesNoString-Comma separated list of fields except ip to be excluded in the response
includeNoString-Possible values are: (1) security - To add ip security information (2) hostname - hostname lookup from IP-Hostname database and returns the same IP address if there is no hostname found for the queried IP address (3) liveHostname - hostname lookup from live sources (4) hostnameFallbackLive - hostname lookup from IP-Hostname database and if there is no hostname found for the queried IP address, then lookup through the live sources (5) user_agent - To parse user-agent information from "User-Agent" header (6) abuse - To add IP abuse contact information (7) dma - To add IP DMA information (8) time_zone - To add time zone information

API Response

For a comprehensive view of the API response structure and detailed field descriptions, explore the interactive Response Table by clicking here.

HTTP Error Codes

HTTP StatusReasons
404
It is returned if the queried IP address or domain name is not found in our database.
423
If the queried IP address is a bogon (bogus IP address from the bogon space) IP address.

How-To-Guides

Lookup by IPv4, IPv6 address or hostname

The IP Location API can be utilized to lookup any IP address or domain name. To determine the geolocation of an IP address, include the ip query parameter in your request with the desired IPv4 or IPv6 address value.

#  Get geolocation for an IPv4 Address = 8.8.8.8
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=8.8.8.8'
# Get geolocation for an IPv6 address = 2001:4860:4860::1
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=2001:4860:4860::1'
# Response for IPv4 address = 8.8.8.8 { "ip": "8.8.8.8", "location": { "continent_code": "NA", "continent_name": "North America", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "country_capital": "Washington, D.C.", "state_prov": "California", "state_code": "US-CA", "district": "Santa Clara", "city": "Mountain View", "locality": "Mountain View", "accuracy_radius": "23.387", "confidence": "low", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421", "is_eu": false, "country_flag": "https://ipgeolocation.io/static/flags/us_64.png", "geoname_id": "6301403", "country_emoji": "🇺🇸" }, "country_metadata": { "calling_code": "+1", "tld": ".us", "languages": [ "en-US", "es-US", "haw", "fr" ] }, "network": { "asn": { "as_number": "AS15169", "organization": "Google LLC", "country": "US", "asn_name": "GOOGLE", "type": "BUSINESS", "domain": "about.google", "date_allocated": "", "allocation_status": "assigned", "num_of_ipv4_routes": "996", "num_of_ipv6_routes": "104", "rir": "ARIN" }, "connection_type": "", "company": { "name": "Google LLC", "type": "", "domain": "" } }, "currency": { "code": "USD", "name": "US Dollar", "symbol": "$" } }

To determine the geolocation and IP details of a hostname, include the ip query parameter in your request with the desired hostname value. This enables precise geolocation lookup for any domain name, providing detailed IP address information.

#  Get geolocation for a hostname = dns.google.com
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=dns.google.com'
# Response { "domain": "dns.google.com", "ip": "8.8.4.4", "location": { "continent_code": "NA", "continent_name": "North America", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "country_capital": "Washington, D.C.", "state_prov": "California", "state_code": "US-CA", "district": "Santa Clara", "city": "Mountain View", "locality": "Mountain View", "accuracy_radius": "12.381", "confidence": "medium", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421", "is_eu": false, "country_flag": "https://ipgeolocation.io/static/flags/us_64.png", "geoname_id": "6301403", "country_emoji": "🇺🇸" }, "country_metadata": { "calling_code": "+1", "tld": ".us", "languages": [ "en-US", "es-US", "haw", "fr" ] }, "network": { "asn": { "as_number": "AS15169", "organization": "Google LLC", "country": "US", "asn_name": "GOOGLE", "type": "BUSINESS", "domain": "about.google", "date_allocated": "", "allocation_status": "assigned", "num_of_ipv4_routes": "996", "num_of_ipv6_routes": "104", "rir": "ARIN" }, "connection_type": "", "company": { "name": "Google LLC", "type": "", "domain": "" } }, "currency": { "code": "USD", "name": "US Dollar", "symbol": "$" } }

Lookup by Client's request IP

When you call the IP to Location API without specifying an ip query parameter, it automatically returns the geolocation information of the client request IP. This feature simplifies obtaining geolocation data for the client's IP, streamlining the process and enhancing the usability of the API.

#  Get geolocation for client's request IP
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY
{ "ip": "39.60.245.243", "location": { "continent_code": "AS", "continent_name": "Asia", "country_code2": "PK", "country_code3": "PAK", "country_name": "Pakistan", "country_name_official": "Islamic Republic of Pakistan", "country_capital": "Islamabad", "state_prov": "Punjab", "state_code": "PK-PB", "district": "Lahore", "city": "Lahore", "locality": "Lahore", "accuracy_radius": "2.991", "confidence": "high", "zipcode": "54000", "latitude": "31.52037", "longitude": "74.35875", "is_eu": false, "country_flag": "https://ipgeolocation.io/static/flags/pk_64.png", "geoname_id": "7043715", "country_emoji": "🇵🇰" }, "country_metadata": { "calling_code": "+92", "tld": ".pk", "languages": [ "ur-PK", "en-PK", "pa", "sd", "ps", "brh" ] }, "network": { "asn": { "as_number": "AS17557", "organization": "Pakistan Telecommuication company limited", "country": "PK", "asn_name": "PKTELECOM-AS-PK", "type": "ISP", "domain": "ptcl.com.pk", "date_allocated": "2001-01-05", "allocation_status": "allocated", "num_of_ipv4_routes": "34359", "num_of_ipv6_routes": "4", "rir": "APNIC" }, "connection_type": "", "company": { "name": "Pakistan Telecommuication company limited", "type": "", "domain": "" } }, "currency": { "code": "PKR", "name": "Pakistan Rupee", "symbol": "₨" } }

JSON / XML Response Format

To customize the response format of your IP geolocation lookup, use the format parameter in your request. If you do not specify a format, the default response will be in JSON. To receive the response in XML format, simply include the format query parameter with the value xml. This flexibility ensures you get the IP geolocation data in the format that best suits your needs, whether it's JSON or XML.

# Get geolocation data in xml format
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=8.8.8.8&format=xml'
# xml Response <LinkedHashMap> <ip>8.8.8.8</ip> <location> <continent_code>NA</continent_code> <continent_name>North America</continent_name> <country_code2>US</country_code2> <country_code3>USA</country_code3> <country_name>United States</country_name> <country_name_official>United States of America</country_name_official> <country_capital>Washington, D.C.</country_capital> <state_prov>California</state_prov> <state_code>US-CA</state_code> <district>Santa Clara</district> <city>Mountain View</city> <locality>Mountain View</locality> <accuracy_radius>23.387</accuracy_radius> <confidence>low</confidence> <zipcode>94043-1351</zipcode> <latitude>37.42240</latitude> <longitude>-122.08421</longitude> <is_eu>false</is_eu> <country_flag>https://ipgeolocation.io/static/flags/us_64.png</country_flag> <geoname_id>6301403</geoname_id> <country_emoji>🇺🇸</country_emoji> </location> <country_metadata> <calling_code>+1</calling_code> <tld>.us</tld> <languages>en-US</languages> <languages>es-US</languages> <languages>haw</languages> <languages>fr</languages> </country_metadata> <network> <asn> <as_number>AS15169</as_number> <organization>Google LLC</organization> <country>US</country> <asn_name>GOOGLE</asn_name> <type>BUSINESS</type> <domain>about.google</domain> <date_allocated></date_allocated> <allocation_status>assigned</allocation_status> <num_of_ipv4_routes>996</num_of_ipv4_routes> <num_of_ipv6_routes>104</num_of_ipv6_routes> <rir>ARIN</rir> </asn> <connection_type></connection_type> <company> <name>Google LLC</name> <type></type> <domain></domain> </company> </network> <currency> <code>USD</code> <name>US Dollar</name> <symbol>$</symbol> </currency> </LinkedHashMap>

Response Filtration

The IP to Location API is designed for precise geolocation data retrieval. By specifying the desired fields in the query parameters, you can tailor the response to include only the information you need. This level of customization ensures you get targeted and relevant geolocation data, enhancing the efficiency of your IP lookup and geolocation tasks. You can customize the API response in two efficient ways:

  1. Use the fields query parameter with a comma-separated list of desired fields to include only those in the response.
  2. Use the excludes query parameter with a comma-separated list of fields you wish to omit from the response.
# Get city information only
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=8.8.8.8&fields=location.city'
{ "ip": "8.8.8.8", "location": { "city": "Mountain View" } } # Get the country name and country code (ISO2) only
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=8.8.8.8&fields=location.country_code2,location.country_name'
{ "ip": "8.8.8.8", "location": { "country_name": "United States", "country_code2": "US" } } # Exclude the continent code, currency
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=8.8.8.8&excludes=location.continent_code,currency'
{ "ip": "8.8.8.8", "location": { "continent_name": "North America", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "country_capital": "Washington, D.C.", "state_prov": "California", "state_code": "US-CA", "district": "Santa Clara", "city": "Mountain View", "locality": "Mountain View", "accuracy_radius": "23.387", "confidence": "low", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421", "is_eu": false, "country_flag": "https://ipgeolocation.io/static/flags/us_64.png", "geoname_id": "6301403", "country_emoji": "🇺🇸" }, "country_metadata": { "calling_code": "+1", "tld": ".us", "languages": [ "en-US", "es-US", "haw", "fr" ] }, "network": { "asn": { "as_number": "AS15169", "organization": "Google LLC", "country": "US", "asn_name": "GOOGLE", "type": "BUSINESS", "domain": "about.google", "date_allocated": "", "allocation_status": "assigned", "num_of_ipv4_routes": "996", "num_of_ipv6_routes": "104", "rir": "ARIN" }, "connection_type": "", "company": { "name": "Google LLC", "type": "", "domain": "" } } } # Get the geolocation and exclude the continent information
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=8.8.8.8&fields=location&excludes=location.continent_code'
{ "ip": "8.8.8.8", "location": { "continent_name": "North America", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "country_capital": "Washington, D.C.", "state_prov": "California", "state_code": "US-CA", "district": "Santa Clara", "city": "Mountain View", "locality": "Mountain View", "accuracy_radius": "23.387", "confidence": "low", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421", "is_eu": false, "country_flag": "https://ipgeolocation.io/static/flags/us_64.png", "geoname_id": "6301403", "country_emoji": "🇺🇸" } }

IP Security Information

The IP Geolocation API also provides valuable IP-Security information, though it is not included by default. To receive IP-Security details alongside geolocation data, add the include=security query parameter to your request. This addition ensures comprehensive insights with your IP geolocation results, significantly enhancing the value and utility of your API usage.

# Get the IP security information
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=8.8.8.8&include=security&fields=location'
{ { "ip": "8.8.8.8", "location": { "continent_code": "NA", "continent_name": "North America", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "country_capital": "Washington, D.C.", "state_prov": "California", "state_code": "US-CA", "district": "Santa Clara", "city": "Mountain View", "locality": "Mountain View", "accuracy_radius": "23.387", "confidence": "low", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421", "is_eu": false, "country_flag": "https://ipgeolocation.io/static/flags/us_64.png", "geoname_id": "6301403", "country_emoji": "🇺🇸" }, "security": { "threat_score": 0, "is_tor": false, "is_proxy": false, "proxy_type": "", "proxy_provider": "", "is_anonymous": false, "is_known_attacker": false, "is_spam": false, "is_bot": false, "is_cloud_provider": false, "cloud_provider": "" } } }

IP Hostname Lookup

The IP Geolocation API also offers hostname lookup for IP addresses, though this feature is not enabled by default. To obtain hostname information along with geolocation data, you can use include query parameter with these three specific values:

  • hostname: Performs a hostname lookup from the IP-Hostname database. If no hostname is found, the response will return the queried IP address.
  • liveHostname: Conducts a hostname lookup from live sources, providing the most current hostname information.
  • hostnameFallbackLive: First attempts a hostname lookup from the IP-Hostname database. If no hostname is found, it then falls back to live sources for the lookup.

By leveraging these parameters, you can enrich your geolocation data with precise hostname information, enhancing the comprehensiveness and accuracy of your IP lookups.

# hostname lookup from IP hostname database
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=8.8.8.8&include=hostname&fields=location'
{ "ip": "8.8.8.8", "hostname": "dns.google", "location": { "continent_code": "NA", "continent_name": "North America", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "country_capital": "Washington, D.C.", "state_prov": "California", "state_code": "US-CA", "district": "Santa Clara", "city": "Mountain View", "locality": "Mountain View", "accuracy_radius": "23.387", "confidence": "low", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421", "is_eu": false, "country_flag": "https:// .io/static/flags/us_64.png", "geoname_id": "6301403", "country_emoji": "🇺🇸" } } # hostname lookup from live sources
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=8.8.8.8&include=liveHostname&fields=location'
{ "ip": "8.8.8.8", "hostname": "dns.google", "location": { "continent_code": "NA", "continent_name": "North America", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "country_capital": "Washington, D.C.", "state_prov": "California", "state_code": "US-CA", "district": "Santa Clara", "city": "Mountain View", "locality": "Mountain View", "accuracy_radius": "23.387", "confidence": "low", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421", "is_eu": false, "country_flag": "https:// .io/static/flags/us_64.png", "geoname_id": "6301403", "country_emoji": "🇺🇸" } } # hostname lookup from IP hostname database with fallback to live sources
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=8.8.8.8&include=hostnameFallbackLive&fields=location'
{ "ip": "8.8.8.8", "hostname": "dns.google", "location": { "continent_code": "NA", "continent_name": "North America", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "country_capital": "Washington, D.C.", "state_prov": "California", "state_code": "US-CA", "district": "Santa Clara", "city": "Mountain View", "locality": "Mountain View", "accuracy_radius": "23.387", "confidence": "low", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421", "is_eu": false, "country_flag": "https:// .io/static/flags/us_64.png", "geoname_id": "6301403", "country_emoji": "🇺🇸" } }

IP Abuse Contact Lookup

IP Geolocation API can also provide abuse contact information associated with an IP address, though it is not included by default. To get abuse contact information along with the geolocation information, you must pass the include=abuse as a query parameter in the URL. This information can be useful for tracking down the source of spam, abuse, or other malicious activities.

# parse user-agent string along with IP geolocation lookup
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=8.8.8.8&include=abuse&fields=location'
{ "ip": "8.8.8.8", "location": { "continent_code": "NA", "continent_name": "North America", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "country_capital": "Washington, D.C.", "state_prov": "California", "state_code": "US-CA", "district": "Santa Clara", "city": "Mountain View", "locality": "Mountain View", "accuracy_radius": "23.387", "confidence": "low", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421", "is_eu": false, "country_flag": "https:// .io/static/flags/us_64.png", "geoname_id": "6301403", "country_emoji": "🇺🇸" }, "abuse": { "route": "8.8.8.0/24", "country": "", "handle": "ABUSE5250-ARIN", "name": "Abuse", "organization": "Abuse", "role": "abuse", "kind": "group", "address": "1600 Amphitheatre Parkway Mountain View CA 94043 United States", "emails": [ "[email protected]" ], "phone_numbers": [ "+1-650-253-0000" ] } }

IP DMA Code Lookup

IP Geolocation API can also provide DMA (Designated Market Area) code, which is a widely used metric for marketing and regional targeting in the United States, though it is not included by default. To get DMA code along with the geolocation information, you can pass the include=dma query parameter in the URL.

# parse user-agent string along with IP geolocation lookup
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=8.8.8.8&include=dma&fields=location'
{ "ip": "8.8.8.8", "location": { "continent_code": "NA", "continent_name": "North America", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "country_capital": "Washington, D.C.", "state_prov": "California", "state_code": "US-CA", "district": "Santa Clara", "city": "Mountain View", "locality": "Mountain View", "accuracy_radius": "23.387", "confidence": "low", "dma_code": "807", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421", "is_eu": false, "country_flag": "https:// .io/static/flags/us_64.png", "geoname_id": "6301403", "country_emoji": "🇺🇸" } }

IP Timezone Lookup

IP Geolocation API can also provide time zone information associated with an IP address, though it is not included by default. To get the time zone information along with the geolocation information, you must need to pass the include=time_zone as a query parameter in the URL.

# parse user-agent string along with IP geolocation lookup
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=8.8.8.8&include=time_zone&fields=location'
{ "ip": "8.8.8.8", "location": { "continent_code": "NA", "continent_name": "North America", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "country_capital": "Washington, D.C.", "state_prov": "California", "state_code": "US-CA", "district": "Santa Clara", "city": "Mountain View", "locality": "Mountain View", "accuracy_radius": "23.387", "confidence": "low", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421", "is_eu": false, "country_flag": "https://ipgeolocation.io/static/flags/us_64.png", "geoname_id": "6301403", "country_emoji": "🇺🇸" }, "time_zone": { "name": "America/Los_Angeles", "offset": -8, "offset_with_dst": -7, "current_time": "2025-09-01 07:15:31.164-0700", "current_time_unix": 1756736131.164, "current_tz_abbreviation": "PDT", "current_tz_full_name": "Pacific Daylight Time", "standard_tz_abbreviation": "PST", "standard_tz_full_name": "Pacific Standard Time", "is_dst": true, "dst_savings": 1, "dst_exists": true, "dst_tz_abbreviation": "PDT", "dst_tz_full_name": "Pacific Daylight Time", "dst_start": { "utc_time": "2025-03-09 TIME 10", "duration": "+1H", "gap": true, "date_time_after": "2025-03-09 TIME 03", "date_time_before": "2025-03-09 TIME 02", "overlap": false }, "dst_end": { "utc_time": "2025-11-02 TIME 09", "duration": "-1H", "gap": false, "date_time_after": "2025-11-02 TIME 01", "date_time_before": "2025-11-02 TIME 02", "overlap": true } } }

User-agent Parsing

The IP to Location API can also parse the user-agent string from the "User-Agent" header. To enable user-agent string parsing, simply add the include=user_agent query parameter to your request. This feature enhances your geolocation data by providing detailed user-agent information, making your IP lookups even more informative and valuable.

# parse user-agent string along with IP geolocation lookup
curl -X 'GET' 'https://api.apifreaks.com/v1.0/geolocation/lookup?apiKey=API-KEY&ip=8.8.8.8&include=user_agent&fields=location'
{ "ip": "8.8.8.8", "location": { "continent_code": "NA", "continent_name": "North America", "country_code2": "US", "country_code3": "USA", "country_name": "United States", "country_name_official": "United States of America", "country_capital": "Washington, D.C.", "state_prov": "California", "state_code": "US-CA", "district": "Santa Clara", "city": "Mountain View", "locality": "Mountain View", "accuracy_radius": "23.387", "confidence": "low", "zipcode": "94043-1351", "latitude": "37.42240", "longitude": "-122.08421", "is_eu": false, "country_flag": "https://ipgeolocation.io/static/flags/us_64.png", "geoname_id": "6301403", "country_emoji": "🇺🇸" }, "user_agent": { "user_agent_string": "PostmanRuntime/7.45.0", "name": "PostmanRuntime", "type": "Robot", "version": "7.45.0", "version_major": "7", "device": { "name": "Postman Runtime", "type": "Robot", "brand": "Postman", "cpu": "Unknown" }, "engine": { "name": "PostmanRuntime", "type": "Robot", "version": "7.45.0", "version_major": "7" }, "operating_system": { "name": "Cloud", "type": "Cloud", "version": "??", "version_major": "??", "build": "??" } } }

Pricing

To use the IP Geolocation API, you will need API credits. We only charge for successful queries, defined by a 2xx status code. If your request results in a 4xx or 5xx status code, no credits will be charged, and any deducted credits will be returned.

For each successful request, 2 credits are charged for basic geolocation data. If you need additional information—such as user-agent parsing, IP security details, or IP hostname data—an extra credit will be charged. By including the include parameter to request these features, the total cost per request will be 2 credits.

ServiceCredits
Basic Geolocation Data2 Credit per successful request
Geolocation + IP Security Data6 Credits per successful request

Utilize the Credits Usage API to efficiently monitor your recent consumption of both one-off and subscription credits. This API provides a streamlined way to track and manage your credit usage, ensuring you stay informed about your remaining balance and can optimize your resource allocation effectively.

Price Estimation Calculator

Ready to get started?

Sign Up for Free

APIFreaks

API Catalog

  • Geolocation APIs
  • WHOIS APIs
  • DNS APIs
  • SSL APIs
  • Domain APIs
  • Screenshot APIs
  • Currency APIs
  • Commodity APIs
  • Timezone APIs
  • Zipcode APIs
  • Email APIs
  • User Agent APIs
  • Other APIs

Tools Catalog

  • Code Formatters
  • Data & Query Tools
  • Text Tools
  • Email Utilities
  • Viewers

Docs

  • APIs
  • Swagger Docs

Pricing & Accounts

  • Pricing
  • Sign up
  • Sign In

Company

  • About Us
  • Resources
  • Terms
  • Privacy

Copyright © 2024

Made in Pakistan