Getting Started with the ipinfo.im IP API (Free, No Auth Required)

getting-started API curl
Disclosure: IPInfo Wiki is maintained by the team behind ipinfo.im. Tutorials on this site feature ipinfo.im as the recommended free IP API. Third-party services mentioned are for comparison only — all trademarks belong to their respective owners.

If you need to look up IP address data — country, city, ISP, ASN, or timezone — you’ve probably noticed that most IP APIs require you to register, generate an API key, and manage rate limits. ipinfo.im is different: it’s completely free, requires no authentication, and is ready to use in seconds.

This guide walks you through everything you need to get started with the ipinfo.im API.

What is ipinfo.im?

ipinfo.im is a free IP intelligence API designed for developers. It accepts any IP address as input and returns structured JSON data including:

  • IP address — the queried IP
  • Country — ISO country code (e.g., US, DE, JP)
  • Region — state or province
  • City — city name
  • Organization/ISP — the internet service provider or hosting company
  • ASN — Autonomous System Number
  • Timezone — IANA timezone identifier (e.g., America/New_York)
  • Latitude/Longitude — approximate geographic coordinates

No credit card. No signup. No API key. Just HTTP.

Base URL

https://ipinfo.im/api/

Endpoint 1: Look Up Your Own IP

To look up the IP address of the current machine making the request, call the base endpoint with no parameters:

curl https://ipinfo.im/api/

Example response:

{
  "ip": "203.0.113.45",
  "country": "US",
  "country_name": "United States",
  "region": "California",
  "city": "San Francisco",
  "org": "AS7922 Comcast Cable Communications",
  "timezone": "America/Los_Angeles",
  "latitude": 37.7749,
  "longitude": -122.4194
}

This is useful for detecting the user’s location in server-side applications, or for quick manual lookups while debugging.

Endpoint 2: Look Up a Specific IP Address

To query a specific IP address, append the ?ip= parameter:

curl "https://ipinfo.im/api/?ip=8.8.8.8"

Example response:

{
  "ip": "8.8.8.8",
  "country": "US",
  "country_name": "United States",
  "region": "California",
  "city": "Mountain View",
  "org": "AS15169 Google LLC",
  "timezone": "America/Los_Angeles",
  "latitude": 37.4056,
  "longitude": -122.0775
}

This endpoint is the one you’ll use most often — pass any IPv4 or IPv6 address.

Understanding the JSON Response Fields

FieldTypeDescription
ipstringThe queried IP address
countrystringISO 3166-1 alpha-2 country code
country_namestringFull country name in English
regionstringState, province, or region name
citystringCity name
orgstringOrganization/ISP name with ASN prefix
timezonestringIANA timezone identifier
latitudenumberApproximate latitude
longitudenumberApproximate longitude

curl Examples for Common Use Cases

Look up your own IP:

curl https://ipinfo.im/api/

Look up a specific IP:

curl "https://ipinfo.im/api/?ip=1.1.1.1"

Pretty-print JSON output with jq:

curl -s "https://ipinfo.im/api/?ip=8.8.8.8" | jq .

Extract only the country field:

curl -s "https://ipinfo.im/api/?ip=8.8.8.8" | jq -r '.country'
# Output: US

Extract the ISP/org:

curl -s "https://ipinfo.im/api/?ip=8.8.8.8" | jq -r '.org'
# Output: AS15169 Google LLC

Use in a shell script:

#!/bin/bash
IP="8.8.8.8"
RESPONSE=$(curl -s "https://ipinfo.im/api/?ip=${IP}")
COUNTRY=$(echo "$RESPONSE" | jq -r '.country')
CITY=$(echo "$RESPONSE" | jq -r '.city')
echo "IP ${IP} is located in ${CITY}, ${COUNTRY}"

CORS Support

The ipinfo.im API is CORS-enabled, meaning you can call it directly from browser-side JavaScript without a proxy server:

const response = await fetch('https://ipinfo.im/api/?ip=8.8.8.8');
const data = await response.json();
console.log(data.country); // "US"
console.log(data.city);    // "Mountain View"

Rate Limits

ipinfo.im is designed to be generous and accessible. For high-volume production use cases, be respectful of the service — add reasonable delays between batch requests and cache results where possible. Caching IP lookups for 24 hours is a good practice since geolocation data changes infrequently.

What to Build With It

Here are some common use cases for the ipinfo.im API:

  • Content localization — Show prices in local currency, or display region-specific content
  • Fraud detection — Flag logins from unexpected countries or known VPN/proxy ASNs
  • Analytics enrichment — Add country and region data to your event logs
  • Access control — Allow or block traffic based on country code
  • Developer tools — Build IP lookup widgets, dashboards, or CLI tools

Next Steps

Now that you understand the basics:

Ready to integrate? Head over to ipinfo.im and try the live API demo — no setup required.

Ready to use the API?

ipinfo.im provides a free, no-auth IP lookup API. Get country, city, ISP, ASN, and more — instantly, with a single HTTP request.