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!)
This entry was posted in api, facebook api, facebook platform, graph api, hashtag, http://schemas.google.com/blogger/2008/kind#post, social, Technology. Bookmark the permalink.

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

  1. Anonymous says:

    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

  2. Anonymous says:

    ur stuff doesn't work or is rly not well explained dude 🙂

  3. Hany Mohamed says:

    it gives me the below error

    {
    “error”: {
    “message”: “(#11) Post search has been deprecated”,
    “type”: “OAuthException”,
    “code”: 11
    }
    }

  4. djin kareep says:

    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
    }
    }

  5. it returns no value, do you know if there is any new query to accomplish this?

  6. didn't work !!
    i think Facebook has developed the version of API to v2.2 and post search isn't supported now.
    is there another way to search for hash !?

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

    this is the result for the above given by u

Leave a comment