Is it possible to get the number of tweets with a certain hashtag? I have been 开发者_Python百科looking in the twitter API but havent found anything, any help?
Thanks!
You have basically two options to get tweets based on a hashtag (none of which will give you all tweets from the past): the search api (see here for usage) to get a limited amount of tweets from the past or the streaming api (using a filter to get current tweets as they happen).
The search api has a limit on the number of tweets it returns. Usually only a couple of days back and maxing out at around 2500 tweets. This very much depends on the hashtag.
The streaming api can be used to get all tweets of a hashtag (assuming that the hashtag is not so popular as to make you hit the streaming api bandwidth limit). -- But not from the past, only new tweets and only as long as you monitor the stream.
A bit late for my answer, but I have found this API which may be of use to you: https://code.google.com/p/otterapi/
And here is a small tutorial to get you started: http://clarklab.com/posts/finding-the-number-of-tweets-for-a-hashtag-or-twitter-account-mentions-using-the-topsy-api/
Unfortunately, it is not free but it offers a 30-day trial so you could try it out and see if it suits your needs.
精彩评论