Developers: Here’s How You Access #Hashtags in Your Apps

I showed earlier tonight a way you can access on Facebook.com the stream for any particular hashtag without having to have a link to get to it. I mentioned Facebook would likely release an API for this. Being the idiot that I am I neglected the fact that Facebook already has a search API, and you can start using it right now.

Anyone, developers or not, can do this right now. Go to https://graph.facebook.com/search – add to it the URI variable q, specify a query (in this case your hashtag keyword prefaced by %23, the URI-encoded version of the # sign), and they add “type=post” to the URI string. In laymans terms, here is how it looks:

https://graph.facebook.com/search?q=%23hashtag&type=post

Just take the above query, put it in your browser (or send it in your app via a GET request), and it will return a JSON-encoded string you can parse and use in your apps. For the non-developers out there, that means there will be a bunch of {‘s and }’s and [‘s and ]’s with the list of all the public posts for that particular hashtag. It’s really simple!

The above example uses the hashtag #hashtag – to change it to something else, just replace “hashtag” with your keyword of choice. This one will do #fail:

https://graph.facebook.com/search?q=%23fail&type=post

Try it yourself and let me know if you see any quirks. So start coding my hacker friends! (and start learning if you’re not!)

8 thoughts on “Developers: Here’s How You Access #Hashtags in Your Apps

  1. Uniform together with best suited temperature is pivotal that
    have ankle towards lamb, no cost a great piece amongst sirloin that is certainly certainly only smart a few or sometimes technique unique.
    One particular particular the complete rooster makes on the subject off Twenty or so minutes.
    They could be included in the non-ionizing assortment electromagnetic radiation, that can be quite different from ionizing light.

    Feel free to surf to my homepage … designer colorful toasters

    Like

  2. m getting an error as below , is there any other way ?

    {
    “error”: {
    “message”: “(#200) Permissions error”,
    “type”: “OAuthException”,
    “code”: 200
    }
    }{
    “error”: {
    “message”: “(#200) Permissions error”,
    “type”: “OAuthException”,
    “code”: 200
    }
    }

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s