google api returns zero results - google-plus

I am attempting to pull Google+ activity data for a public page via the API, yet it returns zero items despite there being many public posts on the profile. Any idea what might be wrong?
Profile Link:
https://plus.google.com/107276257619752352564/posts
API Explorer Link:
https://developers.google.com/apis-explorer/#p/plus/v1/plus.activities.list?userId=114637566932717330174&collection=public&_h=2&

The profile user ID that you provided (107276257619752352564) doesn't match the one you're using in the explorer (114637566932717330174). Executing it with the profile user ID and making sure you've authorized the request appears to return results:
https://developers.google.com/apis-explorer/#p/plus/v1/plus.activities.list?userId=107276257619752352564&collection=public&_h=2&

Related

Facebook API to get the details of events posted by everyone as public

I am trying to get facebook API to give the below information of all the events which are public.
Event name,
Description,
Start date and time,
Location
I have tried using below API in Graph API Explorer. It is giving the response if I give the 'event id' of event created by me. But not all the events which are available publicly.
GET /v12.0/{event-id} HTTP/1.1
Host: graph.facebook.com
Is it like we dont have option to get the details of public events or we have any other API/option to get the public event details?
Thanks in advance!
Since facebooks data restriction update it's no longer possible to get public events of pages because you need to have page-public-metadata-access for this page. Facebook says that you need the following:
successful completion of the App Review process
business verification
admin role for the Page
If you want to get the information of you own pages you just need to give the pages_read_engagement permission and the pages_read_user_content permission.
I was thinking about using scrapy to scrape the data without api but the following link stopped me from doing this https://www.octoparse.com/blog/5-things-you-need-to-know-before-scraping-data-from-facebook.

Using Instagram's Graph API, how can I retrieve post data (media url, caption, poster username, etc)

I want to use Instagram's Graph API on my backend server to retrieve data about an Instagram post. On my frontend, users will submit a post URL (like https://www.instagram.com/p/CAvPIm2lszQ/). Then on my backend, I want to take the ID of the post from that URL (so in this case CAvPIm2lszQ) and then I'm hoping that I can pass that ID thru the Instagram Graph API and then retrieve the data that I need (media URL, caption, poster username, etc.).
So would that be possible? I did find documentation on "IG Media" for the Graph API, but under permissions, it says, "A Facebook User access token from a User who created the IG Media object, with the following permissions.."
Unless I'm misunderstanding it, I'm not sure if I'll be able to access posts from various public accounts. I think it's also worth mentioning that my users are not logging into their Instagram accounts to use my service so the only possible "User access token" would be my own.
Any ideas on how I can go about this? I was using the instagram.com/p/{post_id}/?__a=1 endpoint to meet my needs before but it doesn't work on my production server for some reason. So I'm kinda stuck.
Most probably you will not be able to achieve that using Instagram API. First of all the ID you are referring to CAvPIm2lszQ is not the ID that you will use for getting IG Media. The ID is different (it's numeric value like in the sample request from the page you've linked). The full URL that includes CAvPIm2lszQ is in the shortcode field.
At the moment it is not possible to look for the post detail using shortcode. If you want to use that endpoint you need to get the real post ID first, for instance by listing list of posts from given user.
But in order to do so - you need to use Facebook login authorization window to get token from given user. Alternatively you can try to request https://developers.facebook.com/docs/instagram-api/guides/business-discovery but it requires going through App review and having your own company to pass the Business Verification. Keep in mind that this endpoint returns information only about Instagram Professional accounts (Business/Creator account). You will not be able to get information about regular accounts.
And the last thing about ?__a=1 endpoint. This is not the official Instagram API. They use it only for their own purposes. Most probably your server IP address has been blocked due to sending too many requests.

Instagram: Unable to retrieve media

I've created an application in sandbox on Instagram and I just noticed that despite having the users be a part of my sandbox environment and also following them (and being followed) on Instagram, I am UNABLE to retrieve the media of ONLY those users who've set their account as Private Account. I am able to retrieve media of all the users who've not set any privacy on their account regardless of whether they follow me/I follow them or not.
Now, despite me following and being followed by some users, and also including them as sandbox users of my app, why am I unable to retrieve their data?
API Used: https://api.instagram.com/v1/users/{user-id}/media/recent/?access_token=ACCESS-TOKEN
Link: https://www.instagram.com/developer/endpoints/users/
Instagram API no longer allows retrieving private profiles even if the user has been approved by the private user. This change went into effect with the June 1st 2016 API changes.
private profile can be retrieved using API using the private profile's access_token, but not any other user's access_token (even if approved)

Get Google Plus cover URL by user_id

Is there a way to get the profile picture for a google+ account by using an URL ?
I know that we can get the photo by doing something like: https://plus.google.com/s2/photos/profile/1234567890?sz=200 and I need something similar to get the profile cover photo.
It depends on the URL you have, if you have the user's Google+ ID, you can then retrieve their profile, which contains a link to their profile. An example:
Api Explorer Demo of Retrieving a Cover Photo
Set the fields value to cover/coverPhoto/url if it's not getting added automatically.
There is not a link to access profile photos through the Google+ API. The best way to do this would be to make a GET request to the people.get API endpoint, as follows:
GET https://www.googleapis.com/plus/v1/people/{userId}
That will return a Person resource, which will contain the user's profile image under the id image.

Find Google+ avatar for given email address without OAuth

In my app I want to show the Google+ profile picture for a user.
The only function, I found, in the API to get the profile picture needs a userId.
However, I only have their email adress and not their Google+ userID.
Moreover the person, whose image I want to get, should not be forced to log in and authorize my app, as this person is mostly not identical to the user of the app.
So I think I need to get their userId by email. I read through the Google+ API documentation but can't find a way to do this, but I can't believe that this is not possible.
So my question is:
How can I get the Google+ userID with only an email address?
Is there maybe an other Google API to get a profile picture?
There is an API provided by https://www.avatarapi.com/ which returns the user's name and profile pic from an email address based on Google's public info.
It can be called via SOAP or HTTP at this API endpoint:
https://www.avatarapi.com/avatar.asmx
One of the benefits of this API is that it does not require the user to be authenticated with Google via OAUTH, so this could be exactly what you are looking for.
You can't do this using just their email address, however, if they paste their Google+ url, you could parse the id from the URL string and then get their profile image (and cover image!) using the public data API. The url: https://plus.google.com/me will bring you to their profile.
I highly doubt this is possible. Any kind of querying against the Google Plus API requires OAUTH. What's more, I'm not aware of way to query for a user ID by email address in the first place.
This thread would seem to confirm that this is currently not possible.
You can use the people.search API to search by email address and without requesting the user to authenticate. However, that will only search the public profile fields, which email is not a public field by default.
The only API methods that require OAuth are those that access private data. For public data, you can use the more simple API key method.
To reliably achieve what you are describing, you'll want to use Oauth and the plus.me scope to get the information that you want. This does require authorizing your app however.