← API.MAO.MS Home中文 · 繁體

IP Geolocation Experimental

Look up where an IP address belongs: country, region, city, ISP and AS number, with approximate coordinates outside China.

Endpoint

Method & pathDescription
GET /v1/ipWith no parameters, looks up the caller's own IP; pass ip to look up a specific address. IPv4 and IPv6 supported.
ParameterValuesNotes
ipIPv4 / IPv6 addressOptional; malformed values return 400
langzh / en / hant / tw / hkOptional, default zh; affects error messages and country names (see notes below)
FieldNotes
country / country_codeCountry name and ISO alpha-2 code
province / cityRegion/state and city; null when the database has none
ispFor China, the carrier (e.g. China Telecom / Unicom / Mobile, sometimes an organisation); elsewhere, the ASN organisation name
asnAS number, e.g. 15169
latitude / longitudeApproximate city reference point; only on DB-IP (non-China) results
is_anycastWhether the address matches our built-in list of well-known anycast ranges (list-based: a match is flagged, no match does not rule out anycast; anycast addresses are served from many locations, so any location given is a registered or reference location)
is_privatePrivate/reserved addresses have no geolocation; other fields are null
sourceWhich database produced this result: ip2region / dbip / 自有 (our own logic, e.g. private/reserved)

Examples

An address in China (/v1/ip?ip=223.5.5.5&lang=en):

{"code":0,"message":"ok","data":{"ip":"223.5.5.5","version":4,"country":"中国","country_code":"CN","province":"浙江省","city":"杭州市","isp":"阿里","asn":37963,"latitude":null,"longitude":null,"is_anycast":false,"is_private":false,"source":"ip2region"}}

An overseas anycast address (/v1/ip?ip=8.8.8.8&lang=en):

{"code":0,"message":"ok","data":{"ip":"8.8.8.8","version":4,"country":"United States","country_code":"US","province":"California","city":"Mountain View","isp":"Google LLC","asn":15169,"latitude":37.422,"longitude":-122.085,"is_anycast":true,"is_private":false,"source":"dbip"}}

Country names follow lang (Chinese or English); region/city names in DB-IP Lite are English only, while Chinese addresses get Chinese names from ip2region.

Data sources & how to read the results

This endpoint combines two free offline databases: ip2region answers for China, DB-IP Lite for the rest of the world, each backing up the other; the source field says which one answered, and both are refreshed monthly. IP Geolocation by DB-IP (CC BY 4.0).

Accuracy: IP geolocation is table lookup, not measurement — city level at best, and easily shifted by VPNs, proxies and carrier egress routing. Both free databases are below commercial grade; treat results as a reference only.

Usage statistics

This endpoint group has been called 29 times in total · 0 today · All endpoint statistics

EndpointPathTodayTotal
IP Geolocation/v1/ip029

Live test

Enter an IP and look it up, or just click Look up to see your own

IP Signature Image

A dynamic image for forum signatures and blog sidebars: whoever opens it sees their own IP and location. The generator now lives on the Tools site — ready-to-copy image URLs, Markdown and BBCode snippets, with size and language options.

Use the IP Signature Image on the Tools site →

Visitor Info Card

Paste a small snippet into any web page to show each visitor their own IP, location, ISP and browser. Embed codes and live previews in five styles and three sizes are on the Tools site.

Use the Visitor Info Card on the Tools site →