Business data API related issues


Commercial data API related issues

1. Search recent data interface: search/statuses/limited

(1) Using the same parameters to call the interface can sometimes return data, sometimes an error is reported, and the data is unstable?

In order to ensure the response speed of online services and reduce the load on the server, when accessing downstream services, the timeout is set strictly to 500ms. If the downstream service does not return within 500ms, the access fails. If you want to solve this problem, it is recommended to add a retry mechanism when calling.


(2) Using the same parameters to request the interface twice, the data returned twice are different?

The two searches have different amounts of data, which is normal. The search strategy for searching Weibo, the front-end filtering strategy, the number of sensitive words, and the number of Weibo itself in the database all change dynamically. When QA is testing, the difference between the offline environment and the online environment basically does not exceed 5%. Just think it's normal.


(3) The keywords are the same, only the sort order is different, and the total amount of data returned each time is very different?

The online back-end servers are divided into two groups, one is used for unified search and returns rich data types (selected, articles, comments, users, etc.), and the other is used for business Data, only Weibo data is returned. The index libraries corresponding to different parameter values ​​will be different. In addition, the sort parameter values ​​​​fwnum, cmtnum, and hot are only valid for recent original Weibo, but time is not limited, so these three parameters will be different when returned, and time is very different from others.


(4) When querying a certain keyword on a daily basis, the number of Weibo posts in 30 days is not equal to the number of Weibo posts on a monthly basis?

For searches with more than 1,000 results, the number returned is not the actual number, but an estimated number. This estimate is not affected by the filtering strategy.


(5) Sometimes the data returned by a certain page is less than the amount specified by "count"?

Count refers to the number returned per page. For example, if it is set to 10 items, when 8 items are displayed, it is because those two items have been filtered out. When you visit again, it becomes 10 items again. The index database is dynamic and will push filtered information to the next page or subsequent pages.


(6) The total number of Weibo numbers returned on each page is inconsistent with total_number?

The actual number of results returned does not match total_num. This phenomenon is normal. The reason is that the data in the index is the original data when it is entered into the database. The back-end will return the hit Weibo, but the front-end will filter based on the real-time status of the Weibo. For example, some Weibo are deleted, sensitive words are hit, and users are blocked. wait.


(7) When searching for a certain keyword, the number of Weibo posts in a certain province is not equal to the sum of the number of Weibo posts in the prefectures and cities below it?

The search data comes from the platform. When the user specifies a Weibo in a certain province or city, some flags will be used to determine whether the Weibo is the province or city requested by the user. The specific The reason is that there is no correspondence between fine-grained cities and coarse-grained provinces. For example, if you search for Hebei's Weibo, all items marked as Hebei will be searched, but if you search for Shijiazhuang, all items marked as Hebei will also be searched.


(8) How to use time parameters to search for the most complete data?

The value of the end time parameter is specified as the current time, and the start time does not need to be specified. 1000 Weibo posts will be returned in reverse chronological order, and the creation time of the 1000th Weibo post will be used as the end time parameter. The value of , the starting time does not need to be specified, and it is deferred in sequence.


(9) An error is reported when calling the interface and 403 is returned. What is the reason for the 403 error?

403 error is caused by not logging in or exceeding the frequency limit or exceeding the publishing limit.


(10) How many items can be returned at most when searching for a certain keyword?

Within a certain time interval, search for a certain keyword and return in pages. A maximum of 50 items can be returned per page, and a maximum of 20 pages can be turned, that is, a maximum of 1,000 items can be returned.


(11) For reposted Weibo, if only the original content contains specified keywords but the reposted content does not, can it be searched?

cannot. For forwarded Weibo, the search part is only the forwarded content part, and does not include the name of the Weibo author, emoticons, and forwarded nickname.


2. Return all forwarded Weibo list interfaces of a Weibo: statuses/repost_timeline/all

(1) For multi-level forwarding What is the return information when Weibo calls this interface?

This interface returns a list of all forwarded Weibo posts of a Weibo, including multi-level forwarding. For example, A is forwarded by B, B is forwarded by C, and C is forwarded by D. Call A This API interface returns the number of forwardings B, C, and D. These three levels include. Similarly, when calling this interface for B, C and D are its first and second levels respectively, but when returning data, It is a number of output parameters displayed on the API, with no hierarchical distinction.


(2) Unable to obtain all forwarded Weibo posts of a certain Weibo post when calling the interface?

The forwarding list interface returns a list of all forwardings on Weibo, but the result will filter out invalid users. If the user who forwarded the Weibo is frozen or inactive, the Weibo forwarded by the user cannot be displayed.


3. What is the correspondence between Weibo accounts and applications in the fan service platform and what is the corresponding security mechanism?

The fan service platform currently only supports binding one push address to one application, and does not support binding multiple ones. The fan service platform will perform a verification operation when the first access call is made. For details, please refer to: http://open. weibo.com/wiki/Messages_api_start.


4. How can developers avoid frequency restrictions?

Determine which interfaces need to be accessed regularly, give each interface a priority, and use the frequency of access as a variable; Calculate the amount of interface data that must be accessed; Reserve certain updates for users (Post Weibo, private message, etc.); Use Account/rate_limit_status to check the maximum number of visits per hour that the current appkey can support, and determine the frequency value based on this number of visits.


5. If there is no URL for a single Weibo detail page, how to splice the URL for a single Weibo web page?

Obtain the user's uid in the program, call statuses/querymid to obtain the user's MID, and splice it into http://weibo.com/uid/mid, such as UID=12345, mid=abcde, then The web version address is: http://weibo.com/12345/abcde.