Contacts from People API limited to 100 contats - google-people-api

I see 168 Contacts in my Contacts tab at https://contacts.google.com/.
Although, when I use the People API to retrieve them, using this link: https://people.googleapis.com/v1/people/me/connections?personFields=names,emailAddresses,phoneNumbers,photos, I am only getting back 100 contacts.

The reason why it was not working is that by default there is a limit to the number of contacts you are getting back. You need to include a pageSize parameter in the URL to get all.
add &pageSize=2000 to the one above.

Related

Vimeo API not returning a full page of results

I'm using the Vimeo API to get paged data on my videos. I'm using the per_page and page parameters like so:
https://api.vimeo.com/me/videos?page=4&per_page=8
However, some of the pages of results do not contain 8 videos. For example my 4th page of results is only returning 6 results, yet page 5 has a full set, and there's many more pages. So it's not like I've ran out of videos.
I've checked the video's privacy settings and can't see any differences between the videos that are showing and the videos I'd expect to show on that page that aren't. I've tried setting a sort direction and that didn't help. I've also used the query parameter to search for the videos I think are not showing at they are being returned if I seach for them directly.
Also my auth token scope includes Public, Private and Video Files
I got in contact with Vimeo support. It's due to an issue on their and they have told me they are releasing a fix on the 21st of Feb 2023. In the meantime adding this parameter to the request is a workaround but this will be removed soon.
&include_disabled_by_min_tier=true

Use FB API to get the pages that a page likes?

I've been looking at the documentation for the FB API as it pertains to pages to see if I can get the pages that given page likes and all I can see is a field that lets you get the number of users who like a given page. But, I can't seem to find a field that returns an array containing the ids and names of pages that the page itself likes. This works fine in the API explorer when trying to get the likes of a users.
I just use GET
/me?fields=likes
But, for a page... it doesn't seem to work.
Any ideas?
Put page id, instead of me:
https://graph.facebook.com/PAGE_ID/likes
Example: https://developers.facebook.com/tools/explorer/?method=GET&path=6815841748%2Flikes
Cheers

Graph API returning empty data

For a project I'm required to crawl a few Facebook pages using the Graph API (and R). These pages are MonsterEnergy, RedBull and Rockstar. Monster and Rockstar work just fine, but the Graph API is acting up on RedBull. I can only get the posts that were made today.
Example:
https://graph.facebook.com/14226545351/posts?access_token={valid access token}
When going to the "next" URL, only an empty data array is returned.
I have all the permissions enabled on my access token, and I can see all their posts just fine on their page.
Any idea what could be causing this?
The Facebook tables dealing with the news feed have been hobbled by design. A call with no limits will only return either the last 30 days of data or 50 posts, whichever is fewer. If a page didn't post for more than 30 days, you can end up with nothing returned.
If you need more posts, rather than paging through them, you're better off passing a limit parameter to explicitly request more of them.
Try this:
https://graph.facebook.com/14226545351/posts?limit=100&access_token=ACCESS_TOKEN

How To Get Historical "Facebook Page Likes" Data via Graph API or FQL

Was wondering if anyone knows how to get the historical data for any Facebook Page.
For example, number of fans for RedBull fan page on a given day in the past or for a given period that ends today so that I can show fan development of any page over a given period.
I tried it with the graph API and FQL (insights) but no luck.
https://graph.facebook.com/{USERNAME}/insights?fields=likes&period('week')&end_time_date('2011-06-26') --> empty result
Pulling the data via FQL also returns no results, plus it seems without a read_insights permission nothing is possible for page data
I'd need this to be available with only a generic user access token. This data is publicly available anyway. Result should be somewhat like this: http://www.socialbakers.com/facebook-pages/australia/
https://graph.facebook.com/{{pagename}}/insights/page_views?access_token={{access_token_key}}&since=1420070400&until=1421625600
Since & until parameter in the above code takes in unix time.
add necessary information in the {{ }} and this code should work.
Without insight permission I recommend that you write something to perform a nightly query on the page graph and record the stats you need. If the page is public most of the information shown on that site is available.
You could also scrape info from http://pagedata.appdata.com if the page has already been listed...

Get Facebook "Like" count for every page on my domain

I have integrated the Facebook "Like" button into a lot of pages in my site. I want to display the most "Liked" pages on my site in a list, but I can't figure out how to get that data from Facebook in one request. So far, I have been able to get the "Like" count for individual pages using the following FQL query:
SELECT share_count, like_count, comment_count, total_count
FROM link_stat
WHERE url="http://www.mysite.com/some-page"
However, getting the count for each page on my site one at a time is not really feasible. Aside from having a large number of pages, new pages are being created constantly (new user profiles, new blogs and blog articles, etc), which would make getting complete statistics for my site a complicated process and would involve calling Facebook's API thousands of times.
Is there a way to get a count of how many times each page on my domain has been "Liked" in one request? Or just the top 10 most "Liked" pages, or something similar?
Actually I would do it this way:
$arrayOfPages = array('url1', 'url2', 'url3');
$listOfPages = implode(',', $arrayOfPages);
SELECT share_count, like_count, comment_count, total_count, url
FROM link_stat
WHERE url IN ($listOfPages)
That would give you all the data with the URL as a unique identifier without having to break Facebook's policy against fake users. You can dynamically create the $arrayOfPages variable from a query on your site's database.
In continuation to Salil's answer, here are the some of the major APIs sharedcount.com are using (full list here: http://sharedcount.com/documentation.php)
You can use sharedcount's API to get a general summary, or write something yourself using the APIs:
Facebook: http://api.ak.facebook.com/restserver.php?v=1.0&method=links.getStats&urls=%%URL%%&format=json
Twitter: http://urls.api.twitter.com/1/urls/count.json?url=%%URL%%&callback=twttr.receiveCount
Google +1 +1 counts are retrieved via a JSON-RPC POST call that requires an API key (To get a google API key - https://developers.google.com/+/api/oauth#apikey):
POST URL:
https://clients6.google.com/rpc?key=%%API-KEY%%
POST Body:
[{"method":"pos.plusones.get","id":"p","params":{"nolog":true,"id":"%%URL%%","source":"widget","userId":"#viewer","groupId":"#self"},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}]
It will be difficult to get FB likes for all your pages in one query, but you can get individual share count for every page of your site. Apart from the share count you can also get the breakup of numbers for individual social network for which your site page is shared. Insert you domain name at http://sharedcount.com/?url=http%3A%2F%2Fwww.parasitech.net%2F with appropriate suggestions provided to you. You can get numbers for Facebook, Twitter, Google+, Diggs, Linkedin, Google Buzz, Delicious and StumbleUpon.
Apparently there's no 'LIKE' in FQL. Which was my first suggestion..
Though you can use the "IN" operator, like so:
SELECT share_count, like_count, comment_count, total_count
FROM link_stat
WHERE "http://www.mysite.com/" IN url
ORDER BY like_count
LIMIT 10;
1) create a fake user on fb which will likes only pages from your domain or some other way to save your urls in fb with possibility to get them by FQL later
2) query:
SELECT share_count, like_count, comment_count, total_count
FROM link_stat WHERE url in (SELECT object_id FROM like WHERE user_id="fake_user_id")
3) don`t forget about decrement on 1 each like count ;), sort and show
Maybe you can just query the number of likes for each page each time the page is viewed. This won't be precise, but keeping in mind that the most popular pages will be viewed more often it might be good enough.
Additionally, you can use a batch process to query the number of likes of all the page or at least the top N last created ones every couple of hours. Most of the time you won't get the correct result, but in most cases your users don't need the correct result but a good enough approximation.
If you just need the count from every page, Super Social Media Tracker could provide that.
http://apps.microsoft.com/windows/en-US/app/super-social-media-tracker/a56c8971-42e2-4eb4-9b05-7e52233b4e1e
But it's slow for massive pages.
After some looking around, we may be better off using FQL with graph API:
http://graph.facebook.com/fql?q=select%20comment_count%2C%20share_count%2C%20like_count%20from%20link_stat%20where%20url%20%3D%20%22http%3A%2F%2Fmashable.com%2F2013%2F01%2F30%2Ffacebook-twitter-blackberry-10%2F%22
Results are
{
"data": [
{
"comment_count": 3,
"share_count": 91,
"like_count": 5
}
]
}