I am making a Telegram Bot witch take from user share URL Link from Instagram and pass to user photo or video of that link.
I have got media_id and photo from this Instagram API
https://api.instagram.com/oembed?url=http://instagr.am/p/fA9uwTtkSN/
But when I want to get direct URL of video by media id with below API
https://api.instagram.com/v1/media/{media-id}?access_token=ACCESS-TOKEN
I get Error that media id is invalid I think this is because my access token is in sandbox mode
I do not want to take access token of users I just want to take direct URL of the share URL
what should I do know ?
instagram
Simple add /media/ to URL:
before:
http://instagr.am/p/fA9uwTtkSN/
after:
http://instagr.am/p/fA9uwTtkSN/media/
Related
I'm trying to create an app in which I would like to display user feeds from social media apps like Instagram. I want the data to be as live as possible so I tried to integrate Instagram Webhooks. I have created a server side application with Instagram's authentication and a callback url for webhooks through which I want to fetch data from Instagram and then store it in a database.
I have been going through the Official documentation. I was able to get User id, name, comments through Instagram API and I have also subscribed Instagram's webhooks in my meta developer's application. It didn't throw any error but when I like or comment on my post I couldn't get any object in the callback URL. I'm completely new to this so It would be great if someone could explain me how to do this?
Instagram API removed the following endpoint:
GET /users/search
which I was using to get images from my profile on my website.
Is there any way to do this now? I can't find any info since this is very new.
You can get at least the newest 12 pictures from a public account by using this URL scheme:
https://www.instagram.com/[name_of_account]/?__a=1
You can parse the Json output and find the image-URL in display_url
This also works with hashtags and locations:
https://www.instagram.com/explore/tags/hawaii/?__a=1
you can show your own media,
https://api.instagram.com/v1/users/self/media/recent/?access_token=ACCESS-TOKEN
just enter access token an you will be able to get your media data
I do not see any way via either the old Instagram API or via the new Facebook graph API for Instagram Business Accounts to get profile images for accounts that are not yours. If it is an Instagram Business Account, you could get the Facebook profile image from the Facebook page associated with that Instagram account; but if it is a non-business Instagram account, that won't work. More documentation here: https://developers.facebook.com/docs/instagram-api/overview
How can I fetch other users media through Instagram API, I can easily fetch my media through API. But how can I fetch others users. For fetching my medias I am using
$url = 'https://api.instagram.com/v1/users/self/media/recent/?access_token=' . $token;
But when I try to others users media through username it gives no result.I have also replace "self" with username.But getting no result. I tried many solutions. Is there any way on this planet to get others users media from my access token.
This API deprecated by instagram to fetching other's content.
Here is the detail from Instagram:-
Commenting on Public Content
GET /media/{media-id}/comments (Deprecation not relevant when fetching comments for self media)
POST /media/{media-id}/comments
DEL /media/{media-id}/comments/comment-id
For more details, you can go to page, This is effective from 4th April.
https://www.instagram.com/developer/changelog/
I am using Instagram API to get a user media comments in my site.
I used this endpoint to get comments of specific media:
https://api.instagram.com/v1/media/{media_id}/comments?access_token={media_owner_access_token}
Variables:
{media_id} is media Instagram Id that Instagram gave to me, it's like:
1250190150128742954_182781845
{media_owner_access_token} is access token of media owner that when user registered in my site Instagram gave it to me it's like:
9857164750.81d09db.20b41a2a356d6442bav22d340a55e1f5g
When I try to get media comments for specific media of a user it will give me just media owner comments but this media contains other people comments on it too!
Is this how Instagram API works? Or I made a mistake here?
And for record I am in sandbox mode not live can it be cause of my problem!?
I am in sandbox mode not live can it be cause of my problem!?
Yes. In sandbox mode, the API will only return data from users who have been invited to your sandbox.
From the Instagram API docs:
To help you develop and test your app, the users and media available in Sandbox mode are real Instagram data (i.e. what is normally visible in the Instagram app), but with the following conditions:
Apps in sandbox are restricted to 10 users
Data is restricted to the 10 users and the 20 most recent media from each of those users
Reduced API rate limits
You'll need to get your app approved for live use, and request the proper scopes when generating your token.
See https://www.instagram.com/developer/sandbox/ for more information.
I want to build Instagram client for Ubuntu. I already figured out how to get data like user feed through access token through Instagram API. But I can't figure out how to get user news (e.g. someone liked your photo, mentioned you in comment etc.), I guess user need to be logged on to watch his news (via http://instagram.com/api/v1/news/inbox/).
So, the question: is there any way to get user feed through API, or through access token? I don't want to request user password in my application, all I got is access token.
This endpoint (v1/news/inbox/) is not supported by official Instagram API. By the way; you can't access the data.