All service products
Developer Channel
Service upgrade
Sign in
brief introduction

In order to facilitate the user to retrieve the historical track uploaded to the Eagle Eye platform, the history search function is added. This function can query the terminals that appear in a certain space range in the past. For example, search for terminals in a geographical range from 2:00 pm to 3:00 pm yesterday. Note: This service is an advanced payment service. You can use Apply for trial or purchase Activate the service permission.

Interface list
modular Interface name Function description
historysearch createjob Create Search Task
getjob Query Search
deletejob Delete Search Task
usage method

The methods of using this type of interface are:
Step 1: Create a task using the createjob interface
Step 2: Use the getjob interface to view all tasks of the current service
Step 3: Use the deletejob interface to delete tasks according to job_id

Interface description
Createjob – - Create a retrieval task

When creating a new historical track retrieval task, pay attention to:

1. Only tracks 6 hours before the current time can be retrieved. For example, tasks created at 10:00 on 2021-11-15 can only retrieve tracks generated before 4:00 on 2021-11-15.
2. The search time interval shall not exceed 24 hours, that is, the difference between the end time and the start time shall be within 24 hours.
3. A developer can only have 10 unfinished tasks at the same time. If there are more than 10 unfinished tasks, creation failure will be returned. Please wait until the existing tasks are processed before creating new tasks.

Request URL

https://yingyan.baidu.com/api/v3/historysearch/createjob
//POST request

Request Parameters
Parameter name Field Meaning data type Required remarks
ak

User's AK

string yes
service_id

Service ID, the unique identifier of the service

int yes The service_id returned by the system when the eagle eye service is created in the track management console
start_time

Track start time

UNIX timestamp yes
end_time

Track end time

UNIX timestamp yes Note: The end time should be 12 hours less than the current latest time (that is, only tracks 12 hours ago can be downloaded), and the difference between the end time and the start time should be within 24 hours (that is, only tracks within the 24-hour interval can be downloaded at a time).
around

Center and radius of circle for circle retrieval

string No (either around or borders)

Format: longitude, latitude, radius
The radius shall not exceed 1000m
Example: 119.493328,40.467639100
The around and bounds parameters cannot be both unset or both exist,

bounds

The rectangular range for rectangular retrieval. Note that it is the coordinates in the order of bottom left and top right

string No (either around or borders)

Format: lower left longitude, lower left latitude, upper right longitude, upper right latitude
The rectangular width or height shall not exceed 1000m
Example: 119.493328, 40.467639119.501234, 40.478878
The around and bounds parameters cannot be both unset or both exist

coord_type

Coordinate type returned

string no

Default value: bd09ll
This field is used to control the coordinate type in the returned result. Optional values are:
Gcj02: encrypted coordinates of the National Bureau of Surveying and Mapping
Bd09ll: Baidu longitude and latitude coordinates
This parameter is only valid for domestic (including Hong Kong, Macao and Taiwan) trajectories, and overseas regional trajectories return to wgs84 coordinate system

Return parameters
Parameter name Field Meaning type remarks
status Status code int Return status, 0 means success
message Response information string Chinese description of status
job_id Task id int Task ID, the unique ID of each task
Request Example
Return to Example
{
"status" : zero ,
"message" : Success ,
"job_id" : one
}
Getjob – - query search

Query the tasks in the task pool, which includes the following types of tasks:

1. The task has been created and has not been started
2. Tasks in progress
3. Completed tasks, but the completion time does not exceed 48 hours (note: completed tasks will be automatically cleaned up after 48 hours). Completed tasks will return file_url, paste the address to the browser or use other download methods to obtain the result file. When file_url displays no result, it indicates that no entity has been queried.

Request URL

https://yingyan.baidu.com/api/v3/historysearch/getjob
//GET request

Request Parameters
Parameter name Field Meaning data type Required remarks
ak

User's AK

string yes
service_id

Service ID, the unique identifier of the service

int yes The service_id returned by the system when the eagle eye service is created in the track management console
Return parameters
Parameter name Field Meaning Field Type remarks
status Status code int 0 indicates success, 2 indicates parameter error, and 4 indicates no opening permission. See Status code definition
message Response information string Chinese description of status
job task
job_id Task id int Task ID, the unique ID of each task
start_time Track start time UNIX timestamp
end_time Track end time UNIX timestamp
around Circular retrieval parameters UNIX timestamp
center center of a circle object
longitude longitude double
latitude latitude double
radius radius int Unit: m
bounds Rectangular retrieval parameters object
ll Information in the lower left corner object
longitude longitude double
latitude latitude double
rt Information in the upper right corner object
longitude longitude double
latitude latitude double
coord_type Coordinate type returned string Optional values are:
Gcj02: encrypted coordinates of the National Bureau of Surveying and Mapping.
Bd09ll: Baidu longitude and latitude coordinates.
This parameter is only valid for domestic (including Hong Kong, Macao and Taiwan) trajectories.
create_time Format time of task creation string This time is the server time
modify_time Format time of task creation string This time is the server time
job_status Format time of task creation string Value range:
Waiting: waiting;
Running: running;
Done: Completed, result file can be downloaded
file_url Track data download link string When job_status is done, a download link of the result file will be generated, and developers can download the data file through this link.
Note:
1. Completed tasks will be automatically cleaned up in 48 hours. Please download them in time.
2. When this is automatically displayed as no result, it means that no data has been retrieved.
Export File Description

1. The format of the exported file name is: service_id _ job_id . zip (for example: 135252_10. zip)
2. Use the zip decompression tool to extract the file: service_id _ job_id . json (example: 135252_10. json)
3. Each line of text in the file represents a track data in json format, where:

Request Example
https : / / yingyan . baidu . com / api / v3 / historysearch / getjob ? ak = < User ak > & service_id = < User service_id >
Return to Example
{
"status" : zero ,
"message" : Success ,
"total" : two ,
jobs : [ {
"job_id" : one , "service_id" : two hundred and thirty thousand one hundred and forty-four , "start_time" : one billion six hundred and thirty-nine million four hundred and eleven thousand and two hundred ,
"end_time" : one billion six hundred and thirty-nine million four hundred and twenty-two thousand , "around" : { "center" : { "longitude" : one hundred and nineteen point four nine three three two eight , "latitude" : forty point four six seven six three nine } , "radius" : one hundred } , "coord_type"
: "gcj02" , "create_time" : "20211215192540" , "modify_time" : "20211215192552" , "job_status" : "done" ,
"file_url" : "no result" } ] ,
}
Deletejob – - Delete a search task

Delete task according to job_id

Request URL

https://yingyan.baidu.com/api/v3/historysearch/deletejob
//POST request

Request Parameters
Parameter name Field Meaning data type Required remarks
ak

User's AK

string yes
service_id

Service ID, the unique identifier of the service

int yes The service_id returned by the system when the eagle eye service is created in the track management console
job_id

Task id

int yes Unique ID of each task
sn

The user's permission signature. This parameter is required if the AK verification method used by the user is SN verification. SN calculation method

string no
Return parameters
Parameter name Field Meaning type remarks
status Status code int 0 means success, see Status code definition
message Response information string Chinese description of status
Request Example
Return to Example
{
"status" : zero ,
"message" : Success ,
}

Previous

Batch export track

Next

Custom attribute fields

Is this article helpful to you?