IP Geolocation Lookup Code Examples

IP and Network Intelligence
POST /api/v1/ip/geolocation Bearer

Ready-to-run IP Geolocation Lookup calls. Replace YOUR_API_KEY with the key from your dashboard.

IP Geolocation Lookup — Code Samples

cURL
PHP
Fetch
jQuery
Axios
Python
curl -X POST https://app.way2api.com/api/v1/ip/geolocation \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ip_address":"8.8.8.8"}'

Expected Response — 200

{
    "status": "SUCCESS",
    "status_code": 200,
    "charged": true,
    "success": true,
    "message": "",
    "message_code": "OK",
    "order_id": "W2A1739512345abcdef01",
    "data": {
        "order_id": "W2A1739512345abcdef01",
        "result": {
            "ip_address": "8.8.8.8",
            "location": {
                "continent_code": "NA",
                "continent_name": "North America",
                "country_code": "US",
                "country_code3": "USA",
                "country_name": "United States",
                "country_name_official": "United States of America",
                "country_capital": "Washington, D.C.",
                "state": "California",
                "state_code": "US-CA",
                "district": "Santa Clara",
                "city": "Mountain View",
                "postal_code": "94043-1351",
                "latitude": 37.4224,
                "longitude": -122.08421,
                "is_eu": false,
                "geoname_id": "6301403"
            },
            "country_metadata": {
                "calling_code": "+1",
                "tld": ".us",
                "languages": [
                    "en-US",
                    "es-US",
                    "haw",
                    "fr"
                ],
                "flag_emoji": "🇺🇸"
            },
            "network": {
                "route": "8.8.8.0/24",
                "connection_type": "",
                "is_anycast": true
            },
            "currency": {
                "code": "USD",
                "name": "US Dollar",
                "symbol": "$"
            },
            "asn": {
                "number": "AS15169",
                "organization": "Google LLC",
                "country": "US",
                "type": "business",
                "domain": "google.com",
                "registry": "ARIN",
                "allocated_on": "2000-03-30"
            },
            "company": {
                "name": "Google LLC",
                "type": "hosting",
                "domain": "google.com"
            },
            "time_zone": {
                "name": "America/Los_Angeles",
                "offset": -8,
                "offset_with_dst": -7,
                "current_time": "2026-08-04 06:33:45.664-0700",
                "abbreviation": "PDT",
                "is_dst": true
            }
        }
    }
}