Twitter

FREEMIUM
By davethebeast | Updated 9 дней назад | Social
Popularity

9.9 / 10

Latency

1,885ms

Service Level

100%

Health Check

100%

Back to All Discussions

Search query parameters

Rapid account: Leftleaning 20
leftleaning20
3 месяца назад

Are there any example of how to build a search query using the Twitter query parameters

for example including flags such as
(NASA OR Starlink) -is:retweet -is:reply
to filter out retweets and replies. I’m not sure how the URLencoding should look for this.

TIA

Rapid account: Leftleaning 20
leftleaning20 Commented 3 месяца назад

So I have the query working and getting results but it does not seem to honor flags like
-is:retweet -has:media -is:reply
which works with the official API. I’m continuing testing but if you have any suggestions it would be appreciated.

I am using this endpoint
https://twitter241.p.rapidapi.com/search?type=Latest&count=10&query=(query)

Rapid account: Davethebeast
davethebeast Commented 3 месяца назад

If you are testing the api on RapidAPI platform directly, then no need to urlencode the string, RapidAPI automatically urlencodes it for you, but when you are using it in your code, you need to urlencode it. Please try and let me know because it works from my end.

Rapid account: Leftleaning 20
leftleaning20 Commented 3 месяца назад

Thanks for the reply. I can’t seem to get compounded query items to work. For example the following query format works in the native Twitter API but not in your API when I test the endpoint:

is%3Aretweet%20has%3Amedia%20puppies

https://api.twitter.com/2/tweets/search/recent?query=is%3Aretweet has%3Amedia puppies

Rapid account: Davethebeast
davethebeast Commented 3 месяца назад

You have to urlencode the search query IN YOUR CODE.

Example, The encoding for the for the sample query you gave is: (NASA%20OR%20Starlink)%20-is%3Aretweet%20-is%3Areply

Join in the discussion - add comment below:

Login / Signup to post new comments