Instagram API - Can they provide likes amount? - api

Need to work with the Instagram API
Need these types of data, when I search an Instagram Hashtag #
Get All recent posts with this hashtag
Get Comments_Count, Likes_Count
Account name (of post writer)
Image URL (of post)
URL of post
I tried to work with the Instagram Graph API, having a bit difficulty since its API looks quite different than other APIs, did you manage to find where they put it?

Here is the relevant reference for hashtags, but you can see that there are some significant restrictions on the endpoint.
https://developers.facebook.com/docs/instagram-api/guides/hashtag-search/
You can get data for 30 hashtags a week per Business or Creator account that has authorized your app, so the endpoint is not that useful outside of a few use cases.
If you don't need to track that many hashtags, I believe you can get all of the information EXCEPT the Account Name for the post creator. You would need to register and code an app that can pass review for the Instagram Public Content Access feature and the instagram_basic permission, and then the Business or Creator account would need to authorize your app (and keep it authorized).

Related

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.

How do I get all retweets or the retweeters of my own personal tweet?

I know you must be thinking that its impossible or its been asked already.
But I have 2 queries. The first is that by using Twitter API, using an access token of my own profile, can I get all (more than 100) the retweets of my own tweet? Not someone else's, as all previous questions at stackoverflow have been asked.
Because there's a difference in private and public tweet and getting data related to it.
Secondly, if we cannot get more than 100 retweets, then how does this app Pickaw (formerly Twrench) https://pickaw.com/en gets all the retweets even if they're more than 500 and the corresponding data?
Any ideas?
The Twitter API only provides access to up to 100 Retweeters (IDs for users that RT'd a Tweet), regardless of whether this is your owned Tweet, or another one.
As for a specific app, it is only possible to speculate, unless the source code was Open Source and available. I would suggest there are two ways to get all the Retweets:
pay for premium or enterprise search access, and use the advanced PowerTrack rules to find Retweets of a specific Tweet ID;
use the Account Activity API webhooks to track whenever a user's Tweet is Retweeted. Not that this would only work in a real-time tracking case; you wouldn't be able to check historical Tweets.

Instagram API obtaining users information from those that engages

If I have a following on Instagram that engages with my content, and also has an online presence that has signed up users, is there a way to connect the two?
Is there a way to find out if a user on Instagram likes a photo, and see if that user has signed up on my website?
I wasn't able to find an API endpoint that can get users ID that likes or comments Instagram photos, or even does an action on Instagram stories (watching/swiping up/etc).
Unfortunately, it looks like a change in April of this year deprecated a lot of Instagram endpoints: https://www.instagram.com/developer/changelog/ - GET /media/{media-id}/likes seems like an endpoint you would have found useful, as well as GET /media/{media-id}/comments (the 2nd is deprecated for non-self media).
See also: Did Instagram change API rate limits on Mar 30, 2018?

single client_id vs. user authorization for showing multiple instagram feeds on a website

I'm developing of a community website that features about 500 user profiles. We now want to add the option to show the users' Instagram feed on their profile (with their consent). Going through the instagram API documentation some questions arose concerning the right approach about permissions and the review process.
Can anyone clarify if the following is a working approach and a valid use case regarding instagram's policy: Creating one client ID / access token for the website that is used to communicate serverside with the Instagram API, using the public_content permission to query the members' timeline. Server side caching would ensure that the rate limits are respected.
Since we need read-only access to public content only we would like to avoid managing authorization of every single member.
Thanks!
In the recent API changes Instagram removed the ability to use the client_id for requests and now an access_toek obtained by authorising and Instagram account is required for everything
You could make an account for your website, authorize it and use its access_token, but it will need to apply for the public_content permission and I don't thin Instagram will like this use case. Also with 500 accounts you may hit your Ali request limit.
The better option is to require uses to authorise their Instagram account if they want their recent posts on their profile and use their token to get their recent posts. This way you don't need the public_content permission

Getting the last post from a Google+ company Page using REST API

I am developing a website for a hotel company. The client wants the home page of the new website to show the last post made on its Google+ Page. Unfortunately, I cannot rely on the "embedded post" feature, because the layout will have to be fully custom. Neither my company nor my client is a Google Partner or owns a Google Apps for Businsess account. Reading through the documentation, it seems that Pages API are accessible only by partners.
Two questions:
Do I actually need to use Pages API in order to access the company page stream?
Do we actually have to become Google Partners just to perform such a simple integration task?
I was about to walk along a long, winding and useless road. The post stream of a page can be retrieved with the Activities.list method, and the last post can be selected by specifying a proper value for the maxResults parameter
https://developers.google.com/+/web/api/rest/latest/activities/list
By using the "API explorer", we can see that the userId field can actually be filled with a "page id". For example, if we want to obtain the stream of the following page:
https://plus.google.com/102884112172662547291
we shall pass 102884112172662547291 as userId.