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
Únase a la conversación, añada un comentario a continuación:
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)
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.
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
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