Query City Information

Last Updated on : 2023-07-06 08:28:01download

Query the information about cities by longitude and latitude.

API address

GET: /v2.0/iot-03/automations/cities/positions

Request parameter

Parameter nameTypeINRequiredDescription
lonStringquerytrueThe longitude, accurate to 6 digits after the decimal separator.
latStringquerytrueThe latitude, accurate to 6 digits after the decimal separator.

Return parameter

Parameter nameTypeDescription
resultAreaResThe returned result.

Description of result

Parameter nameTypeDescription
city_idStringThe ID of a specified city.
city_nameStringThe name of a specified city.
province_nameStringThe name of a province or state.

Request example

GET: /v2.0/iot-03/automations/cities/positions?lon=-118.331359&lat=34.000664

Return example

{
    "result": {
        "province_name": "California",
        "city_name": "Los Angeles",
        "city_id": "101069444120988****"
    },
    "t": 1635390466504,
    "success": true
}

Error code

For more information, see error code.