English
English
简体中文
Contact Us
Register
Log In
layoutIndex

Get the Location by IP Address

Last Updated on : 2022-08-01 06:00:01download

Get the geo-location by IP address.

API address

GET: /v1.0/iot-03/locations/ip

Request parameter

Parameter nameTypeINRequiredDescription
ipStringquerytrueThe IP address.

Return parameter

Parameter nameTypeDescription
resultLocationResultDTOThe returned result.

Description of result

Parameter nameTypeDescription
country_codeStringThe country code.
national_numberStringThe country number.
longitudeStringThe longitude. Valid values: -180 to 180.
latitudeStringThe latitude. Valid values: -90 to 90.
continent_codeStringThe continent code.

Request example

GET: /v1.0/iot-03/locations/ip?ip=1.1.1.1
{}

Return example

{
    "latitude": "39.90469",
    "nationalNumber": "86",
    "countryCode": "CN",
    "continentCode": "AS",
    "longitude": "116.40717"
}

Error code

For more information, see error code.