naik899
naik899

Reputation: 116

API to search if facebook page exists or not by name

I want to check if a particular facebook page exists by giving in name. Is there any Graph API like that or are there any api which would give me fb page details by passing in fb pagename?

Please let me know

Upvotes: 1

Views: 2047

Answers (2)

andyrandy
andyrandy

Reputation: 74014

That is what the Search API is for, check it out in the official docs: https://developers.facebook.com/docs/graph-api/using-graph-api#search

Edit: This is no longer possible: https://developers.facebook.com/docs/graph-api/changelog/breaking-changes/#search-4-4

More information on this thread: https://stackoverflow.com/a/49868085

Upvotes: 2

seeker70
seeker70

Reputation: 57

Just in case this is helpful for anyone who is looking to do this currently (as current as v3.2 of the Graph API) without needing a token, I've discovered the following:

If you check the graph api for a name or ID like this:

https://graph.facebook.com/?id=SOME_NAME_OR_PAGE_ID_HERE

If you do not have an access token and the page DOES exist, you will get an error message with code "104," letting you know that you need a token to access the resource. If you do not have an access token and the page DOES NOT exist, you will instead get code "803," with a message saying the page does not exist. So even without a token, if all you need to know is whether or not it exists, you can do it by checking the code that gets returned.

Upvotes: 4

Related Questions