Twitter Search API not returning data

restapi
rest
search

#1

Hello Twitter team,

We are facing an issue wherein the tweet search functionality is giving us some hard time. We are using the following documentation links:

Documentation Link: https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets.html
Documentation to build the query: https://developer.twitter.com/en/docs/tweets/rules-and-filtering/guides/using-premium-operators

However we are facing a peculiar issue when the first call is giving us results, but the subsequent call is failing.

This is the query for which we are looking for results:
"“Office365” OR “Office 365” OR “SharePoint” OR “OneDrive for Business” OR “OneDriveforBusiness” OR “Skype for Business” OR “SkypeforBusiness” OR “Teams” OR “Yammer” OR #o365 -イカナカマ -美少女 -幼馴染 -ガチャ -ikanakama -野球 -AKB -渋谷 -#渋大 -#重ねた足跡公演 -哈利波特 -広告非表示などプレミアム機能追加 -新たな仮想通貨取引所 -SKE -SKE -鮫浦湾 -江戸川 -ポケモン -嘘じゃない -RT Lang:ja"

The call is working fine but when I use max_id parameter, the API call does not return any data.

Can you please guide me regarding this.
Thanks.


#3

Some notes here:

  • you’re using the standard API search endpoint (not the premium search), so you should look at https://developer.twitter.com/en/docs/tweets/search/guides/standard-operators to build the query.
  • with_twitter_user_id is no longer a supported parameter, but I think Twitter4J is including it for you automatically
  • count=101 is not valid since that parameter tops out at 100 results.
  • it is redundant to use lang:ja in the query and also have lang=ja on the API call.

What API response do you receive? What HTTP headers are you seeing?

Have you been able to reproduce this using twurl?


#4

Thanks @andypiper for the response.

I tried again based upon your suggestions:
The response that I get on using max_id is:

{"errors":[{"code":195,"message":"Missing or invalid url parameter."}]}

Is there any limitation with the query formation? I could not find anything related to this in the documentation.

Thanks.