How to get media of specific instagram account by hashtag? - facebook

I want to get media of specific Instagram account (my account) by hashtag. I followed the instruction of Instagram Graph API but maybe the result maybe returned all media of all user by hashtag.
Does anyone have any idea ? Thanks !
Reference: https://developers.facebook.com/docs/instagram-api/hashtag-search

If I understand you correctly, you want to get all of an Instagram business account's posts that include a particular hashtag? One can use the call:
<INSTAGRAM_BUSINESS_ACCOUNT_ID>/media?fields=caption
To get an Instagram business accounts posts, including the caption. Then, one can parse the caption field to derive what hashtags were used in each post.

Related

Which Instagram API should I use to collect public data?

Does either the Instagram Basic Display API or the Instagram Graph API allow me to simply get any public user's posts/media programatically? Everywhere in the documentation it says "User data" but it feels like I can only get data of the user that got authenticated using the API. I've set up a Facebook dev account and currently spending 4th hour on calling both APIs without success. Can anyone who has used them help me clear this up?
Most likely, Instagram API Date 365, a tool I currently work for, may help you as an alternative to using Instagram Basic Display API or the Instagram Graph API because this API is created especially for scraping bulk data about posts and users.
You can get such post data as post content (text, language, list of hashtags, list of tagged users), owner ID, location ID,
engagement info, etc. Also, it is possible to download comments (selected or on a specific post) and replies to them.
You can view this for more info.

Get like_count & comments_count for Instagram Media object with Facebook Instagram API

I'm trying to build a simple widget that helps users to get their Instagram feed on their websites. I have already got my FB app approved for instagram_graph_user_profile and instagram_graph_user_media permissions.
Now, whenever I try to get the number of likes/comments through the below API call, I get data for all the fields, except like_count and comments_count.
https://graph.instagram.com/me/media?fields=id,media_type,media_url,username,comments_count,like_count,timestamp,permalink,comments_count,caption,children,thumbnail_url&access_token={access_token}
I'm not sure if I'm missing something. So, any advice would be appreciated.
For those looking to integrate it to business / creator accounts. You may want to look at this link for the supported fields. Also be sure to check the required permissions.
Sample HTTP Get: https://graph.facebook.com/v11.0/{media_id}?fields=id,caption,media_type,like_count,comments_count,media_url&access_token={access_token}

Can I get all posts from instagram based on a specific tag with the new Facebook Graph API?

Right now I am using Instagram API Platform with the "Public Content
- capabilities to read public media on a user's behalf" rights for my app. As it is stated on the website, it will be deprecated on December 11, 2018 and they are pointing to the new Instagram Graph API.
I went through the documentation but could not find what I need. I would like to know if it is possible with the new API to:
Get all posts info (user that posted, the number of followers, caption, likes count and the media itself). With the Mentions API from Instagram Graph API you can get all posts where your Business account is tagged #account, but they require media_id which I don't have, how do I get it?
Get all posts with a specific hashtag, of a specific user (non-business account) within a timeframe. From the comments it is clear that this is not possible for now. Still hope to get an answer to my first question.
I would like to know if the above mentioned are possible with the new API and it would be nice if you can point me to the right API. Thank you in advance
but they require media_id which I don't have, how do I get it?
You can get the list of media id's on which an account has been tagged using the tags endpoint.
v4.0/<account id>?fields=tags
Once you have the list of media items in which the account has been tagged, you can cycle through them and return the following fields each media post.
Returnable Fields: caption, comments, comments_count, like_count, media_type, media_url, owner — The ID of the user who owns the object., timestamp, username
With the owner ID of the post you might be able to look up more of the fields you are looking for, but you will likely run into some permission issues.

How to get number of like, share, comment of post of Facebook, Instagram and Twitter?

I am making ios and android apps and I want to get number of likes, shares, comments of any post that is posted by particular user from his/her Facebook, Instagram and Twitter accounts.
Means how can we get number of like, share, comment of the particular user's post of Facebook, Instagram and Twitter?
Does Facebook, Instagram and Twitter APIs/SDKs support this?
Please provide any reference link to achieve this.
I'm not sure about twitter or instagram API's but facebook graph API allows you to do this, given that you have the necessary permissions.
You can always check the public data, your own posts and such..if you want to have access to the data of a particular users feed/posts they will need to provide you with that permission. (user_posts in this case)
As for the total count you can retrieve it by adding .summary(1) to the end of your query ex. for likes, comments and shares.
me?fields=posts{comments.summary(1),likes.summary(1),shares}
you can also limit the number of comments/likes/shares to zero so that you retrieve only the total count per post. If that is what you want simply ad .limit(0) before the .summary(1) ex. comments.limit(0).summary(1)
Shares however are different from comments/likes/reactions, you can only retrieve the count of shares from graph API therefore you do not need to provide anything other than the "shares" query to the post to recieve that.
Cheers!

How to get public Facebook Page data no matter the country/language admin selected?

As you may know, Facebook Page Administrators can select for posts to be visible to only certain countries/langauges ( https://www.facebook.com/note.php?note_id=180817924821 ).
However, I would like to use the Graph API to retrieve feed messages ( /feed ) for ALL countries/languages or be able to select data for a specific country.
For example:
1) I would like to get ALL posts (and comments ...) from all of Starbucks Facebook Page. So no matter what the administrator says, just ALL.
2) I would like to be able to retrieve only the posts that are visible to users in Germany.
Are both these example actually possible? Probably, because I use access_tokens Facebook will probably use my own country/langauge to decide what data I get so that would mean I would have to change country all the time which is of course not an option to ask my users.
Any of you know what to do?
This is only possible if you're using the app as an admin of the posting page.
As you mentioned, the API will detect the user behind your access_token and only display posts that would normally be accessible to them on the desktop site.
This is an intentional restriction, so there's no way around it.