Frequently asked questions about microservices

Issues related to business data API

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

(1) Calling the interface with the same parameters sometimes returns data, sometimes reports an error, and the data is unstable?

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


(2) Request the interface twice with the same parameters, and the returned data results are different?

The data volume of the two searches is different, which belongs to the normal category. The search strategy, front-end filtering strategy, the number of sensitive words and the number of microblogs in the database are all dynamic changes. When QA tests, it is considered normal if the offline environment and online environment are diff, and it basically does not exceed 5%.


(3) The keywords are the same, but the sort sorting is different. The total amount of data returned each time is very different?

The online back-end servers are divided into two groups. One group is used for unified search, and the returned data types are rich (selections, articles, comments, users, etc.). The other group is used for business data, and only the microblog data is returned. Different parameter values correspond to different index libraries. In addition, the sort parameter values fwnum, cmtnum, and hot are only valid for recent original microblogs, but the time is unlimited, so the three parameters will be different when returning, and the time is very different from other parameters.


(4) When a keyword is queried on a daily basis, the number of microblogs in 30 days is not equal to the number of microblogs in a monthly basis?

For a search with more than 1000 results, the number returned is not the actual number, but the estimated number, which is not affected by the filtering policy.


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

Count refers to the number of returned items per page. For example, if it is set to 10 items, when 8 items are displayed, it is because those two items are filtered out, and when accessed again, it becomes 10 items. Because the index database is dynamic, it will squeeze the filtered information to the next page or the next page.


(6) Is the total number of microblogs returned per page inconsistent with total_number?

The actual number of returned results does not match the total_num, which is normal. The reason is that the data in the index is the original data at the time of warehousing. The backend will return the hit microblog, but the front section will filter according to the real-time status of microblog, such as some microblogs are deleted, hit sensitive words, and users are blocked.


(7) When searching for a keyword, is the number of microblogs in a province equal to the total number of microblogs in the cities below?

The search data comes from the platform. When a user specifies a province or city's microblog, he or she will judge whether the microblog is the province or city required by the user according to some flag bits. The specific reason is that there is no correspondence between fine-grained cities and coarse-grained provinces. For example, when searching Hebei's microblog, those marked as Hebei will be searched, but when searching Shijiazhuang, Those marked as Hebei will also be searched.


(8) How to use time parameters to search 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 microblogs will be returned in reverse chronological order, and the creation time of the 1000th microblog will be taken as the value of the end time parameter. The start time does not need to be specified, and it will be recursively.


(9) What is the reason for the 403403 error reported when calling the interface?

403 An error is reported when the user does not log in or exceeds the frequency limit or the release limit.


(10) How many entries can be returned by searching a keyword?

In a certain time interval, search for a keyword, and return in pages. Each page can return up to 50 entries, and you can turn 20 pages at most, that is, up to 1000 entries.


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

No. For the forwarded microblog, the retrieval part is only the forwarded content part, and does not include the microblog author name, emoticon, and forwarded nickname.


2. Return a Weibo All Forwarded Weibo List interface: statuses/repost_timeline/all

(1) What is the return information of multi-level forwarding microblog when calling this interface?

This interface returns a list of all forwarded microblogs of a microblog, including multi-level forwarding. For example, A is forwarded by B, B is forwarded by C, and C is forwarded by D. Calling this API interface for A, the number of returned forwarding is B, C, and D. These three levels all include. Similarly, calling this interface for B, C and D are the first and second levels, respectively. However, when returning data, they return several output parameters displayed on the API, without any hierarchical distinction.


(2) Can't get all forwarded microblogs of a microblog when calling the interface?

The forwarding list interface returns a list of all the forwarded microblogs, but the result will filter invalid users. If the user who forwards microblog is in frozen status or inactive status, the microblog forwarded by the user cannot be displayed.


3. What is the corresponding relationship between microblog accounts and applications in the fan service platform and the corresponding security mechanism?

At present, the fan service platform only supports one application to bind one push address, but does not support binding multiple. The fan service platform will perform a verification operation when accessing and calling for the first time, please refer to: http://open.weibo.com/wiki/Messages_api_start .


4. How can developers avoid frequency restrictions?

Determine which interfaces need regular access. Each interface has a priority and the access frequency is a variable; Calculate the amount of interface data that must be accessed; Reserve certain updates for users (microblogging, private messages, etc.); Use Account/rate_limit_status to view the maximum number of accesses per hour that the current appkey can support, and determine the frequency value based on this number of accesses.


5. Without the url of the detailed page of a single microblog, how can I splice the web page address of a single microblog?

Get the user's uid in the program, call statuses/querymid to get the user's MID, and splice it into http://weibo.com/uid/mid If UID=12345, mid=abcde, the web page address is: http://weibo.com/12345/abcde

Updated on: December 18, 2015