I'm trying to collect tweet data which has specific hashtag by using twitter api.
I use the python code below.
https://github.com/twitterdev/Twitter-API-v2-sample-code/blob/master/Recent-Search/recent_search.py
It does work seemingly.
However, when I change the line 14 from
query = "from:twitterdev -is:retweet"
to
query = "#apple"
it does not work anymore. Error message is below.
Exception: (400, '{"errors":[{"parameters":{"query":[""]},"message":"Invalid \'query\':\'\'. \'query\' must be a non-empty string"}],"title":"Invalid Request","detail":"One or more parameters to your request was invalid.","type":"https://api.twitter.com/2/problems/invalid-request"}')
It seems to relate #. How can I fix this?