Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: IP-API.io - IP Geolocation & Security IP Geolocation &…
description: 'Comprehensive IP address intelligence API providing geolocation, security analysis, and network information.
Features:
- Real-time IP geolocation with city-level accuracy
- Advanced threat detection and security scoring
- VPN, proxy, and Tor node detection
- Email validation and reputation analysis
- Email / ip risk scoring for fraud prevention
Perfect for fraud prevention, security applications, content personalization, and compliance requirements.'
contact:
name: IP-API.io Support
url: https://ip-api.io
email: support@ip-api.io
license:
name: Commercial License
url: https://ip-api.io
version: 1.0.0
servers:
- url: https://ip-api.io
description: Production server
security:
- ApiKeyAuth: []
tags:
- name: IP Geolocation & Security API
description: 'Advanced IP address intelligence service providing geolocation, security analysis, and threat detection.
**Core Features**:
- High-precision geolocation (city-level accuracy)
- Real-time timezone and local time calculation
- Comprehensive threat intelligence (VPN, proxy, Tor detection)
- ISP and network classification
- Abuse and reputation scoring
**Security Analysis**:
- Proxy & VPN detection with 99.5% accuracy
- Tor node identification (real-time consensus)
- Spam and malware source detection
- Datacenter and hosting provider classification
- Threat intelligence from 50+ global feeds
**Geolocation Accuracy**:
- Country: 99.8% accuracy
- City: 85-95% accuracy (varies by region)
- Coordinates: ~50km median accuracy
**Use Cases**: Fraud prevention, content localization, compliance, analytics, security monitoring'
paths:
/api/v1/ip/batch:
post:
tags:
- IP Geolocation & Security API
summary: Batch IP lookup — analyze up to 100 IPs in a single request
description: 'Performs geolocation and security analysis on multiple IP addresses in one request.
**Batch Processing**:
- Up to 100 IP addresses per request
- Duplicate IPs are automatically deduplicated
- IPs processed concurrently for sub-second total response time
- Results returned as a map keyed by IP address
**Quota Management**:
- One quota unit deducted per unique IP address
- Quota checked before any processing begins (no charge if insufficient)
- Quota deducted only after ALL lookups complete successfully
- No quota charged if batch processing fails or request is invalid
**Error Handling**:
- HTTP 400: Malformed IP address format (no charge)
- HTTP 429: Insufficient quota (no charge)
- Private/reserved IPs are included in results with limited data and still consume quota
**Use Cases**:
- Bulk fraud screening of user registrations
- Log analysis and threat intelligence
- Network auditing and security monitoring
- Geolocation of large IP datasets'
operationId: lookupIpBatch
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/BatchIpLookupRequestDto'
required: true
responses:
'200':
description: Batch lookup completed successfully with intelligence for all processed IPs
content:
application/json:
schema:
$ref: '#/components/schemas/BatchIpLookupResponseDto'
'400':
description: Bad Request — invalid IP format, empty list, or exceeds maximum batch size of 100
content:
'*/*':
schema:
$ref: '#/components/schemas/BatchIpLookupResponseDto'
'429':
description: Too Many Requests — insufficient quota for the batch size (no quota consumed)
content:
'*/*':
schema:
$ref: '#/components/schemas/BatchIpLookupResponseDto'
'500':
description: Internal Server Error — geolocation service temporarily unavailable
content:
'*/*':
schema:
$ref: '#/components/schemas/BatchIpLookupResponseDto'
/api/v1/ip:
get:
tags:
- IP Geolocation & Security API
summary: Get IP intelligence from client request
description: 'Automatically analyzes the client''s IP address from HTTP request headers for comprehensive intelligence gathering.
**IP Detection Strategy**:
1. **X-Real-IP Header**: Preferred for load balancers and reverse proxies
2. **X-Forwarded-For**: First non-private IP in the chain
3. **RemoteAddr**: Direct connection IP (fallback)
**Analysis Includes**:
- Precise geolocation with city-level accuracy
- Real-time timezone calculation with DST detection
- Comprehensive security threat assessment
- Network classification (residential, datacenter, mobile)
- ISP and organization identification
**Use Cases**:
- User session fraud detection
- Content personalization by location
- Timezone-aware application behavior
- Real-time security monitoring
**Privacy**: No personal information is logged or stored'
operationId: getIpInfoNoIp
responses:
'200':
description: IP intelligence gathered successfully with complete analysis
content:
application/json:
schema:
$ref: '#/components/schemas/IpInfoV1Dto'
'400':
description: Bad Request - Unable to extract valid IP address from request headers
content:
'*/*':
schema:
$ref: '#/components/schemas/IpInfoV1Dto'
'422':
description: Unprocessable Entity - Private IP address cannot be geolocated
content:
'*/*':
schema:
$ref: '#/components/schemas/IpInfoV1Dto'
'429':
description: Too Many Requests - Rate limit exceeded (check X-RateLimit-* headers)
content:
'*/*':
schema:
$ref: '#/components/schemas/IpInfoV1Dto'
'500':
description: Internal Server Error - Geolocation service temporarily unavailable
content:
'*/*':
schema:
$ref: '#/components/schemas/IpInfoV1Dto'
/api/v1/ip/{ip}:
get:
tags:
- IP Geolocation & Security API
summary: Get comprehensive IP intelligence for specific address
description: 'Performs detailed analysis of a specific IP address providing geolocation, security assessment, and network intelligence.
**Geolocation Analysis**:
- Country, region, and city identification
- Latitude/longitude coordinates with accuracy indicators
- Postal/ZIP code when available
- ISP and organization details
- Connection type classification
**Security Intelligence**:
- Real-time threat assessment from 50+ feeds
- VPN and proxy detection with confidence scoring
- Tor network node identification
- Spam source and malware C&C detection
- Datacenter and hosting classification
**Timezone Intelligence**:
- IANA timezone identification
- Current local time calculation
- Daylight saving time detection
- UTC offset determination
**Performance**: Sub-second response with global CDN caching
**Accuracy**: 99.8% country, 90%+ city-level precision'
operationId: getIpInfoFullPath
parameters:
- name: ip
in: path
description: 'IP address for comprehensive intelligence analysis.
**Supported Formats**:
- IPv4: Standard dotted decimal (e.g., 203.0.113.195)
- IPv6: Full or compressed format (e.g., 2001:db8::1)
**Limitations**:
- Private ranges (RFC 1918) return limited geolocation data
- Reserved ranges (RFC 5735/4291) may return partial information
- Localhost (127.x.x.x, ::1) returns minimal data
**Performance Notes**:
- Cached results: < 50ms response time
- Fresh lookups: < 500ms response time
- Global POPs for reduced latency
**Examples**:
- Public IPv4: 8.8.8.8, 1.1.1.1
- Public IPv6: 2001:4860:4860::8888
- Corporate: 203.0.113.195'
required: true
schema:
type: string
example: 203.0.113.195
responses:
'200':
description: Complete IP intelligence analysis with geolocation and security data
content:
application/json:
schema:
$ref: '#/components/schemas/IpInfoV1Dto'
'400':
description: Bad Request - Invalid IP address format (must be valid IPv4 or IPv6)
content:
'*/*':
schema:
$ref: '#/components/schemas/IpInfoV1Dto'
'422':
description: Unprocessable Entity - Private/reserved IP ranges cannot be geolocated
content:
'*/*':
schema:
$ref: '#/components/schemas/IpInfoV1Dto'
'429':
description: Too Many Requests - Rate limit exceeded (check X-RateLimit-* headers)
content:
'*/*':
schema:
$ref: '#/components/schemas/IpInfoV1Dto'
'500':
description: Internal Server Error - Geolocation or threat intelligence service unavailable
content:
'*/*':
schema:
$ref: '#/components/schemas/IpInfoV1Dto'
components:
schemas:
IpInfoV1Dto:
type: object
description: 'Comprehensive IP address intelligence response containing geolocation, security analysis, and network information.
Provides detailed analysis including precise location data, threat intelligence assessment,
timezone information, and network classification for fraud prevention and security applications.
**Data Sources**: Global threat intelligence feeds, geolocation databases, ISP registries
**Update Frequency**: Real-time threat data, weekly geolocation updates'
example:
ip: 203.0.113.195
isp: Comcast Cable Communications
asn: AS7922
suspicious_factors:
is_proxy: false
is_tor_node: false
is_spam: false
is_crawler: false
is_datacenter: true
is_vpn: false
is_threat: false
location:
country: United States
country_code: US
city: San Francisco
latitude: 37.7749
longitude: -122.4194
zip: '94105'
timezone: America/Los_Angeles
local_time: '2023-06-21T14:30:00-07:00'
local_time_unix: 1687385400
is_daylight_savings: true
properties:
ip:
type: string
description: 'The IP address that was analyzed, returned in standard format.
**Normalization Applied**:
- IPv4: Standard dotted decimal notation
- IPv6: Compressed format when possible
- Case normalization for IPv6
**Note**: Returned format may differ from input due to standardization'
example: 203.0.113.195
isp:
type:
- string
- 'null'
description: Internet Service Provider name derived from the ASN organization field.
example: Deutsche Telekom AG
asn:
type:
- string
- 'null'
description: Autonomous System Number in AS<number> format.
example: AS3320
suspicious_factors:
$ref: '#/components/schemas/SuspiciousFactorsV1Dto'
description: 'Comprehensive security threat analysis and suspicious activity indicators.
Contains multiple boolean flags indicating various types of potentially
malicious or suspicious network behavior associated with the IP address.
**Data Sources**: Real-time threat intelligence from 50+ global security feeds
**Update Frequency**: Continuous updates with sub-minute latency for new threats'
location:
$ref: '#/components/schemas/LocationV1Dto'
description: 'Geographic location and timezone information for the IP address.
Provides detailed location data including coordinates, administrative regions,
timezone details, and local time calculations with daylight saving consideration.
**Accuracy Levels**:
- Country: 99.8% accuracy
- City: 85-95% accuracy (varies by region)
- Coordinates: ~50km median accuracy radius'
required:
- ip
- location
- suspicious_factors
BatchIpLookupRequestDto:
type: object
description: "JSON request containing list of IP addresses to analyze.\n\n**Request Requirements**:\n- Must contain 1–100 IP addresses\n- Each IP must be valid IPv4 or IPv6 format\n- Maximum 45 characters per IP address\n\n**Example Request**:\n```json\n{\n \"ips\": [\n \"8.8.8.8\",\n \"1.1.1.1\",\n \"203.0.113.195\"\n ]\n}\n```"
example:
ips:
- 8.8.8.8
- 1.1.1.1
- 203.0.113.195
properties:
ips:
type: array
description: 'List of IP addresses to look up. Maximum 100 IPs per request.
**Format Requirements**:
- Standard IPv4 dotted decimal (e.g., 8.8.8.8)
- IPv6 full or compressed format (e.g., 2001:db8::1)
- Maximum 45 characters per address
- Must be structurally valid IP format
**Batch Processing**:
- Duplicate IPs are automatically deduplicated before processing
- Quota is deducted only after successful completion of all lookups
- Invalid IP formats result in HTTP 400 with no quota charged'
example:
- 8.8.8.8
- 1.1.1.1
- 203.0.113.195
items:
type: string
required:
- ips
SuspiciousFactorsV1Dto:
type: object
description: "Comprehensive security threat assessment and suspicious activity indicators.\n\nContains boolean flags for various types of potentially malicious or suspicious\nnetwork behavior, enabling fine-grained security decision making.\n\n**Detection Methods**: \n- Machine learning classification models\n- Real-time threat intelligence feeds\n- Behavioral pattern analysis\n- Network fingerprinting techniques"
example:
is_proxy: false
is_tor_node: false
is_spam: false
is_crawler: false
is_datacenter: true
is_vpn: false
is_threat: false
properties:
is_proxy:
type: boolean
description: 'Indicates if the IP address is operating as a proxy server.
**Proxy Types Detected**:
- HTTP/HTTPS proxies (transparent, anonymous, elite)
- SOCKS proxies (v4/v5)
- Residential proxy services
- Data center proxy pools
**Detection Accuracy**: 99.5% with < 0.1% false positive rate
**Risk Level**: Medium to High (depends on proxy type)
**Use Cases**: Fraud prevention, content protection, geo-compliance'
example: false
is_tor_node:
type: boolean
description: 'Indicates if the IP address is part of the Tor anonymity network.
**Node Types Detected**:
- Tor exit nodes (highest risk)
- Tor relay nodes (medium risk)
- Tor bridge nodes (medium risk)
**Data Source**: Real-time Tor consensus data updated every hour
**Risk Level**: High - Often blocked due to anonymization
**Detection Confidence**: 100% (official Tor directory)'
example: false
is_spam:
type: boolean
description: 'Indicates if the IP address has been associated with spam or malicious email activity.
**Activity Types Detected**:
- Email spam campaigns
- Phishing email sources
- Malware distribution via email
- Compromised email servers
- Botnet email activity
**Risk Level**: High - Strong indicator of malicious intent
**Data Sources**: Multiple global spam databases and threat feeds
**Update Frequency**: Real-time with hourly consolidation'
example: false
is_crawler:
type: boolean
description: 'Indicates if the IP address is identified as a web crawler, scraper, or automated bot.
**Bot Types Detected**:
- Search engine crawlers (Google, Bing, etc.)
- Social media bots
- Content scrapers
- Price monitoring bots
- SEO analysis tools
**Risk Level**: Low to Medium (legitimate vs. malicious crawlers)
**Use Cases**: Rate limiting, content protection, analytics filtering
**Note**: Includes both legitimate and potentially harmful automated traffic'
example: false
is_datacenter:
type: boolean
description: 'Indicates if the IP address originates from a datacenter or cloud hosting environment.
**Infrastructure Types**:
- Major cloud providers (AWS, GCP, Azure, etc.)
- Dedicated server hosting
- Virtual private servers (VPS)
- Colocation facilities
- Content delivery networks (CDN)
**Risk Level**: Medium - Less likely to be genuine residential users
**Use Cases**: Bot detection, user verification, residential filtering
**Coverage**: 5000+ hosting providers globally'
example: true
is_vpn:
type: boolean
description: "Indicates if the IP address belongs to a VPN (Virtual Private Network) service.\n\n**VPN Types Detected**:\n- Commercial VPN providers (NordVPN, ExpressVPN, etc.)\n- Corporate VPN gateways\n- Self-hosted VPN servers (OpenVPN, WireGuard)\n- Mobile VPN applications\n\n**Detection Methods**: \n- ISP classification analysis\n- Traffic pattern recognition\n- Known VPN server databases\n\n**Risk Level**: Medium - Privacy tool but can indicate location spoofing\n**Database Coverage**: 2000+ VPN providers with 50M+ IP ranges"
example: false
is_threat:
type: boolean
description: 'Indicates if the IP address has been flagged as an active security threat.
**Threat Categories**:
- Malware command & control servers
- Botnet participants
- Attack source IPs (DDoS, bruteforce)
- Phishing and fraud infrastructure
- Compromised devices and servers
**Risk Level**: Very High - Immediate security concern
**Data Sources**: Global threat intelligence partnerships
**Response Recommendation**: Block or apply enhanced scrutiny
**Update Frequency**: Real-time threat feed integration'
example: false
required:
- is_crawler
- is_datacenter
- is_proxy
- is_spam
- is_threat
- is_tor_node
- is_vpn
BatchIpLookupResponseDto:
type: object
description: Response object containing geolocation and security intelligence results for all processed IPs in a batch request.
example:
results:
8.8.8.8:
ip: 8.8.8.8
suspicious_factors:
is_proxy: false
is_tor_node: false
is_spam: false
is_crawler: false
is_datacenter: true
is_vpn: false
is_threat: false
location:
country: United States
country_code: US
city: Mountain View
latitude: 37.4056
longitude: -122.0775
zip: '94043'
timezone: America/Los_Angeles
local_time: '2024-01-15T10:30:00-08:00'
local_time_unix: 1705340400
is_daylight_savings: false
total_processed: 3
successful_lookups: 3
failed_lookups: 0
properties:
results:
type: object
additionalProperties:
$ref: '#/components/schemas/IpInfoV1Dto'
description: 'Map of IP addresses to their full intelligence results. The key is the original IP address.
IPs that could not be resolved (e.g., private ranges) are excluded from the map and counted in failed_lookups.'
total_processed:
type: integer
format: int32
description: Total number of unique IPs processed in this batch.
example: 3
successful_lookups:
type: integer
format: int32
description: Number of IPs that returned a successful geolocation result.
example: 3
failed_lookups:
type: integer
format: int32
description: Number of IPs that could not be resolved (e.g., private ranges, reserved addresses).
example: 0
required:
- failed_lookups
- results
- successful_lookups
- total_processed
LocationV1Dto:
type: object
description: "Comprehensive geographic location and timezone intelligence for an IP address.\n\nProvides detailed location data including administrative regions, precise coordinates,\ntimezone information, and real-time local time calculations with daylight saving awareness.\n\n**Geolocation Accuracy**:\n- Country: 99.8% accuracy\n- Region/State: 95% accuracy \n- City: 85-95% accuracy (varies by region and population density)\n- Coordinates: Median accuracy radius of ~50km\n\n**Data Sources**: Multiple commercial and open geolocation databases"
example:
country: United States
country_code: US
city: San Francisco
latitude: 37.7749
longitude: -122.4194
zip: '94105'
timezone: America/Los_Angeles
local_time: '2023-06-21T14:30:00-07:00'
local_time_unix: 1687385400
is_daylight_savings: true
properties:
country:
type:
- string
- 'null'
description: 'Full country name where the IP address is geolocated.
**Language**: English country names using ISO 3166-1 standard
**Coverage**: All 249 countries and territories
**Null when**: IP address cannot be geolocated (private ranges, invalid IPs)
**Examples**: "United States", "United Kingdom", "Germany", "Japan\"'
example: United States
country_code:
type:
- string
- 'null'
description: 'ISO 3166-1 alpha-2 country code (two-letter country identifier).
**Standard**: ISO 3166-1 alpha-2 (official country codes)
**Format**: Two uppercase letters
**Null when**: Country cannot be determined
**Examples**: "US", "GB", "DE", "JP", "CA", "AU"
**Use Cases**: Country-based filtering, compliance rules, localization'
example: US
city:
type:
- string
- 'null'
description: 'City or municipality name where the IP address is located.
**Accuracy**: 85-95% depending on region (higher in developed countries)
**Language**: English city names with local variations
**Null when**: City cannot be determined or IP is in rural area
**Examples**: "New York", "London", "Tokyo", "San Francisco"
**Note**: May include districts or boroughs for large metropolitan areas'
example: San Francisco
latitude:
type:
- number
- 'null'
format: double
description: 'Latitude coordinate of the estimated IP address location in decimal degrees.
**Format**: Decimal degrees (-90.0 to 90.0)
**Precision**: Up to 6 decimal places
**Accuracy**: Median radius of ~50km from actual location
**Coordinate System**: WGS84 (World Geodetic System 1984)
**Positive values**: North of equator
**Negative values**: South of equator
**Null when**: Location cannot be determined'
example: 37.7749
maximum: 90.0
minimum: -90.0
longitude:
type:
- number
- 'null'
format: double
description: 'Longitude coordinate of the estimated IP address location in decimal degrees.
**Format**: Decimal degrees (-180.0 to 180.0)
**Precision**: Up to 6 decimal places
**Accuracy**: Median radius of ~50km from actual location
**Coordinate System**: WGS84 (World Geodetic System 1984)
**Positive values**: East of Prime Meridian
**Negative values**: West of Prime Meridian
**Null when**: Location cannot be determined'
example: -122.4194
maximum: 180.0
minimum: -180.0
zip:
type:
- string
- 'null'
description: "Postal or ZIP code for the IP address location.\n\n**Format**: Country-specific postal code formats\n**Availability**: Varies by country (high coverage in US/Canada/Europe)\n**Accuracy**: Generally accurate to postal district level\n**Null when**: Postal code not available or cannot be determined\n\n**Examples**: \n- US: \"94105\", \"10001\"\n- UK: \"SW1A 1AA\", \"M1 1AA\" \n- Canada: \"K1A 0A6\"\n- Germany: \"10115\\\""
example: '94105'
timezone:
type:
- string
- 'null'
description: 'IANA timezone identifier for the IP address location.
**Format**: IANA Time Zone Database format (Area/Location)
**Examples**: "America/New_York", "Europe/London", "Asia/Tokyo"
**Null when**: Timezone cannot be determined
**Use Cases**:
- Localized time display
- Business hours calculation
- Scheduling applications
- Regulatory compliance (trading hours, etc.)'
example: America/Los_Angeles
local_time:
type:
- string
- 'null'
description: 'Current local time at the IP address location in ISO 8601 format.
**Format**: ISO 8601 with timezone offset (YYYY-MM-DDTHH:mm:ssZ)
**Calculation**: Real-time based on system clock and timezone data
**DST Aware**: Automatically adjusts for daylight saving time
**Null when**: Timezone information not available
**Examples**:
- "2023-06-21T14:30:00-07:00" (PDT)
- "2023-06-21T22:30:00+01:00" (BST)
- "2023-06-22T07:30:00+09:00" (JST)'
example: '2023-06-21T14:30:00-07:00'
local_time_unix:
type:
- integer
- 'null'
format: int64
description: "Current local time as Unix timestamp (seconds since epoch).\n\n**Format**: Integer seconds since January 1, 1970 00:00:00 UTC\n**Precision**: Second-level accuracy\n**Timezone**: Adjusted to local timezone (not UTC)\n**Null when**: Timezone information not available\n\n**Use Cases**: \n- Programming language datetime conversion\n- Database timestamp storage\n- Cross-platform time synchronization\n\n**Example**: 1687385400 represents \"2023-06-21T14:30:00-07:00\\\""
example: 1687385400
is_daylight_savings:
type:
- boolean
- 'null'
description: 'Indicates whether the location is currently observing daylight saving time.
**True**: Location is currently in daylight saving time (summer time)
**False**: Location is in standard time (winter time)
**Null**: Timezone information not available OR location doesn''t observe DST
**DST Regions**: North America, Europe, parts of Australia, etc.
**Non-DST Regions**: Most of Asia, Africa, South America
**Update Frequency**: Real-time calculation based on current date and timezone rules
**Use Cases**: Business hours calculation, scheduling, compliance'
example: true
securitySchemes:
ApiKeyAuth:
type: apiKey
in: query
name: api_key
description: API key (free key generated on signup at https://ip-api.io)