Twitter: Hash tag search query

Tjekkles picture Tjekkles · Mar 14, 2011 · Viewed 37.4k times · Source

I am trying to search twitter tweets by a given hashtag. I am trying to get the correct http query, but I have no idea which one. I've tried a few but i can't find the correct one.

I should use the http://api.twitter.com/1/... link.

I already have a search http query by a given name which works correctly

http://api.twitter.com/1/statuses/user_timeline.json?screen_name=prayforjapan

Now I would like to search by a given hashtag (for example #prayforjapan)

I tried using a few, but can't find the correct one as I said before. Here's one I tried:

http://api.twitter.com/1/statuses/public_timeline.json?include_entities=true&hashtag=prayforjapan"

Does anyone know which one I should use?

Thanks!

Answer

gnab picture gnab · Mar 14, 2011

You can simply fetch http://search.twitter.com/search.json?q=%23test to get a list of tweets containing #test in JSON, where %23test is #test URL encoded.