C/2/search/statuses/historical/create-en
search/statuses/historical/create
Create the task of searching for historical data
URL
https://c.api.weibo.com/2/search/statuses/historical/create.json
Supported Formats
JSON
HTTP Request Method
POST
Login Requirement
true
See Login and Authorization for details.
Authorized Access Limitation
Request for all the business API:
- 50000 times per hour per IP;
- 50000 times per hour per IP;
Request Parameters
Requires | Type and Range | Description | |
---|---|---|---|
source | false | string | This parameter is not needed when using OAuth, and is required when using other authorization methods. The value of this parameter is AppKey. |
access_token | false | string | This parameter is required when using OAuth, and is not needed when using other authorization methods. You will get the access_token after obtaining OAuth. |
q | false | string | Search keywords. Up to 1000 keywords with no more than 24 Chinese or English characters separated by half-width comma could be designated. The post with any matched keyword can be elected. This parameter must be URL encoded. |
ids | false | string | Search for posts from designated batch users. Up to 50 UIDs separated by '~' could be transferred. |
province | false | int | Province ID to search. Refer to the Code List by Province and City for details. All posts from designated province will be returned if parameter 'q' is empty. |
city | false | int | City ID to search. Refer to the Code List by Province and City for details. All posts from designated province will be returned if this parameter is empty. Multiple cities can be passed, separated by half-width comma. |
starttime | true | int64 | Start time for searching. The value of this parameter is timestamp (accurate to second) |
endtime | true | int64 | End time for searching. The value of this parameter is timestamp (accurate to second, no later than the last second of the previous day |
type | false | int | Designate the post type: 0 for the original post; 1 for the repost; default as null/empty means both. |
hasv | false | int | Whether is the post from 'V' users? 0 for false; 1 for true, default as null means both. |
onlynum | false | int | Only return the total amount ? 0 for true; 1-100 for the designated percentage. For instance, 80 stands for returning 80% of the eligible data(by uniform sampling). Default as 100. |
Notes
- Search task cannot be created business data quota less than 1000. Otherwise, task can be created with 1000 quota deducted as the base fee.
- The data returns in reverse chronological order.
- This search task could be trace back to 2012, and interval between start time and end time should be no more than one month.
- The latest data could be retrieved with no more than 1 day delay.
- The parameter 'province' and 'city' refers to the province and city where the post IP located.
- For the repost, search is based on the repost content instead of the original content.
- One of the three parameters: 'q', 'province', 'ids' must be assigned.
- This interface does not support fuzzy search. It executes exact match query according to the parameter 'q'.
- The parameter 'province' must be designated when parameter 'city' is assigned.
- If multiple cities are passed, the field city from response result is the number of cities you have passed, rather than the exact city code you have passed.
Response
JSON Example
//成功返回 { "id": "3567122345", //任务创建者ID "q": "昆明暴力事件,三元食品", "ids": "324344545~12121343~789078912", "province": "11", "city": "5", "starttime": "1389628800", "endtime": "1389690595", "type": 1, "hasv": 1, "onlynum": 80, "task_id": "100", //任务ID "secret_key": "384323434" //任务创建成功后,返回密钥,用于查看任务执行状态、及下载结果数据 } //失败返回 { "request": "/2/search/statuses/historical/create.json", "error_code": "2111XX", "error": "error message." }
Please see Error Code Description for details of error information.
Field Description
none
Others
- If you designate the time parameter later than 2012 and still receive error 'start time cannot be earlier than 2012', please add three 0 at the end of the value to change the format to millisecond instead of second.