Appearance
违停区域查询 API
违停区域查询 API 用于查询指定坐标位置是否处于违停或限停区域内,帮助判断车辆停放是否合规。
违停区域查询 API
接口描述
根据传入的经纬度坐标,查询该位置是否处于违停或限停区域内。
请求方式
| URL | 请求方式 |
|---|---|
| https://lbs.xiaojukeji.com/api/v2/parking_judge | POST、GET |
请求
查询参数(GET)
| 参数名 | 必选 | 类型 | 描述 | 示例值 |
|---|---|---|---|---|
| key | 是 | string | 鉴权用的 API Key | YOUR_API_KEY |
| location | 是 | string | 查询点经纬度,格式为"lng,lat"(经度,纬度) | 116.314230,39.979392 |
Header 参数
| 参数名 | 必选 | 类型 | 描述 | 示例值 |
|---|---|---|---|---|
| didi-header-rid | 否 | string | 标识一次请求,不传时会自动生成一个 | 550e8400-e29b-41d4-a716-446655440000 |
请求体参数(POST)
当使用POST方法时,请求体应为 ParkingJudgeRequest 模型的JSON格式。
| 参数名 | 必选 | 类型 | 描述 | 示例值 |
|---|---|---|---|---|
| location | 是 | string | 查询点经纬度,格式:lng,lat | 116.314230,39.979392 |
json
{
"location": "116.314230,39.979392"
}请求示例
GET
shell
curl -X GET "https://lbs.xiaojukeji.com/api/v2/parking_judge?key=YOUR_API_KEY&location=116.314230,39.979392"POST
shell
curl -X POST "https://lbs.xiaojukeji.com/api/v2/parking_judge?key=YOUR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"location": "116.314230,39.979392"
}'响应
成功响应为 ParkingJudgeResponse 模型的JSON格式。
json
{
"status": "状态码,整数",
"msg": "返回消息",
"trace_id": "请求追踪 ID",
"results": {
"parking_status": "违停状态:NO_PARKING/LIMIT_PARKING/NORMAL",
"limit_duration": "限停时长(秒),仅在 LIMIT_PARKING 时返回,整数"
}
}响应示例
正常区域(可停车):
json
{
"status": 10000,
"msg": "success",
"trace_id": "0ac5186e67e50a9c190b048d5ef3dab0",
"results": {
"parking_status": "NORMAL"
}
}禁止停车区域:
json
{
"status": 10000,
"msg": "success",
"trace_id": "0ac5186e67e50a9c190b048d5ef3dab1",
"results": {
"parking_status": "NO_PARKING"
}
}限停区域:
json
{
"status": 10000,
"msg": "success",
"trace_id": "0ac5186e67e50a9c190b048d5ef3dab2",
"results": {
"parking_status": "LIMIT_PARKING",
"limit_duration": 180
}
}