How can I obtain a list of domains for a page/user/app using the Graph API? - facebook

I'm trying to use Facebook's Graph API to grab a user's insights data, and display it in an admin panel for them, as a part of their custom CMS.
There are a few steps to my Facebook integration:
1. Authenticate
2. Get a list of pages, applications, and domains for the user
3. Get insights data for each page, application and domain
All of the above are working, but I can't find a way to list all the domains a user has. I'm using https://graph.facebook.com/me/accounts to get the list of accounts for the user. This is returning all the Pages and Applications, but no Domains.
I have looked all over Facebook's docs, and can't find any reference to a method for retrieving a list.
I have tried https://graph.facebook.com/domains, https://graph.facebook.com/me/domains, https://graph.facebook.com/domain, and https://graph.facebook.com/me/domain - to no avail. https://graph.facebook.com/domain and https://graph.facebook.com/domains are valid, but are only useful if you know the domain.
So, the question: Is there a way to obtain a list of domains for a user using the Graph API?
Thanks

try this Graph API call: https://graph.facebook.com/fql?q=SELECT domain_name, domain_id FROM domain WHERE domain_id in ( SELECT domain_id FROM domain_admin WHERE owner_id=me())&access_token=VALIDUSERACCESSTOKENOFTHEOWNEROFTHEDOMAIN

Related

How to get FB Graph API Business Rating

I have recently started using Facebook's Graph API. I was wondering is there a way I can get just the overall rating of a business that I am not the owner of the page of. I am aware that there is a ratings edge that allows you to pull all reviews if you have a page-access token but I do not have this and do not need that detailed information. I do not see any fields in the "page" documentation and do not want to resort to scraping. This will be used in an app to compare businesses.
It is not possible to get ratings/reviews of a Page you don´t own. As you found out yourself, you do need a Page Token, and you don´t get one if your user does not belong to any Page role. There is no way to get the ratings/review in that case, and scraping is not allowed: https://www.facebook.com/apps/site_scraping_tos_terms.php

How to use facebook graph api to get all the current employees of a company?

The new graph search on facebook page allows you to search for current employees of a company by typing a query like "Current Google employees" on the top search bar.
Now how to do the same via Graph API? Or if not possible via Graph API, then I am thinking of scrapping it using say, Scrapy, but then it redirects me to the login.php page. Any help would be appreciated.
Thanks
It's not possible via Graph API based on how permissions and privacy in the API work.
I am not rolled out to Graph Search but I'm guessing each query has a specific page and you can use Scrapy to pull it. The reason you are being redirected is because you don't have the proper headers and cookies (such as dtsg and datr) to see the page. You need Scrapy to impersonate the user of the page.
Though, it wouldn't make sense building an application like this. The whole point of the API is so that you don't scrape pages without their permission. This sounds like a sure way to ask for a cease and desist once you usage is noticable.

Determine first 50 likes via Facebook Graph API

Is it possible to get for example the first 50 people who liked a post, photo, whatever I created on facebook via the Graph API? Is there any kind of order when accessing connections like /likes or /comments?
Use the following link (given that you have permissions to access to the post):
/likes?limit=50
This should be the first 50 likes ordered via Facebook (usually based on time).
ASFAIK, you cannot get a list of people who like a page. It's a privacy issue. If you wanted to create an app, and users authorized your app, then you could get a list of the current users friends who like the page.

Facebook : List of all pages liked by

I am new to Facebook's Graph API and FQL. I want small information about the same.
I want to get List of all pages liked by any particular user.
I have used Graph API just to allow user to get logged in with their Facebook ID and Can access their wall but don't know much about rest of the this.
I searched on Google for same but got information about list of pages that user administrate that I don't want, I want full list which is like by them.
It's a connection property of the User object.
https://developers.facebook.com/docs/reference/api/user/#likes

how can i get all the FB graph id's associated with a domain?

taking imdb.com for example. imdb.com has hundreds of pages with a FB graph ID (one per each movie)
I want to fetch ALL FB graph ID's belonging to imdb.com.
for example: the FB graph ID for http://www.imdb.com/title/tt1515091/ is "113109502056333"
I know this because I can "like" the URL, then using the "Graph API Explorer" I can see the ID of the liked URL.
Question: How can I get ALL FB graph id's of URL's belonging to a single domain? please use imdb as an example.
keep in mind, I do NOT want to send FB a batch of predetermined URL's. My website has hundreds of URL's and will not be able to compile a list of all URL's.
Thanks!
You can't! There is no way to get all OpenGraph objects that reside under the domain via Graph API or FQL.
OpenGraph pages are linked to URL and not to domain.