Tap or your profile picture in the bottom right to go to your profile. Tap in the top right, then tap Your activity. Tap Download your information. Enter the email address where you'd like to receive a link to your data, then tap Request Download.
The Instagram Basic Display API allows users of your app to get basic profile information, photos, and videos in their Instagram accounts. The API can be used to access any type of Instagram account but only provides read-access to basic data.
The API can be used to get and publish their media, manage and reply to comments on their media, identify media where they have been @mentioned by other Instagram users, find hashtagged media, and get basic metadata and metrics about other Instagram Businesses and Creators.
var name = "smena8m";
$.get("https://images"+~~(Math.random()*3333)+"-focus-opensocial.googleusercontent.com/gadgets/proxy?container=none&url=https://www.instagram.com/" + name + "/", function(html) {
if (html) {
var regex = /_sharedData = ({.*);<\/script>/m,
json = JSON.parse(regex.exec(html)[1]),
edges = json.entry_data.ProfilePage[0].graphql.user.edge_owner_to_timeline_media.edges;
$.each(edges, function(n, edge) {
var node = edge.node;
$('body').append(
$('<a/>', {
href: 'https://instagr.am/p/'+node.shortcode,
target: '_blank'
}).css({
backgroundImage: 'url(' + node.thumbnail_src + ')'
}));
});
}
});
html, body {
font-size: 0;
line-height: 0;
}
a {
display: inline-block;
width: 25%;
height: 0;
padding-bottom: 25%;
background: #eee 50% 50% no-repeat;
background-size: cover;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
You can download any Instagram user photo feed in JSON format using ?__a=1
next to landing page address like this. No need to get user id or register an app, no tokens, no oAuth.
min_id
and max_id
variables can be used for pagination, here is example
YQL
may not work here inside snipped iframe, so you can always check it manually in YQL Console
APRIL 2018 UPDATE: After latest instagram updates you can't do this on client side (javascript) because custom headers for signed request can't be set with javascript due to CORS
Access-Control-Allow-Headers
restrictions. It still possible to do this via php
or any other server side method with proper signature based on rhx_gis
, csrf_token
and request parameters. You can read more about it here.
JANUARY 2019 UPDATE: YQL retired, so, check my latest update with Google Image Proxy as CORS
proxy for Instagram page! Then only negative moment - pagination not available with this method.
PHP
solution:
$html = file_get_contents('https://instagram.com/apple/');
preg_match('/_sharedData = ({.*);<\/script>/', $html, $matches);
$profile_data = json_decode($matches[1])->entry_data->ProfilePage[0]->graphql->user;
This is late, but worthwhile if it helps someone as I did not see it in Instagram's documentation.
To perform GET on https://api.instagram.com/v1/users/<user-id>/media/recent/
(at present time of writing) you actually do not need OAuth access token.
You can perform https://api.instagram.com/v1/users/[USER ID]/media/recent/?client_id=[CLIENT ID]
[CLIENT ID] would be valid client id registered in app through manage clients (not related to user whatsoever).
You can get [USER ID] from username by performing GET users search request:
https://api.instagram.com/v1/users/search?q=[USERNAME]&client_id=[CLIENT ID]
11.11.2017
Since Instagram changed the way they provide this data, none of above methods work nowadays. Here is the new way to get user's media:
GET https://instagram.com/graphql/query/?query_id=17888483320059182&variables={"id":"1951415043","first":20,"after":null}
Where:query_id
- permanent value: 17888483320059182 (note it might be changed in future).id
- id of the user. It may come with list of users. To get the list of users you can use following request: GET https://www.instagram.com/web/search/topsearch/?context=blended&query=YOUR_QUERY
first
- amount of items to get.after
- id of the last item if you want to get items from that id.
I was able to get the most recent media of a user using the following API without authentication (including the description, likes, comments count).
https://www.instagram.com/apple/?__a=1
E.g.
https://www.instagram.com/{username}/?__a=1
As of last week, Instagram disabled /media/
urls, I implemented a workaround, which works pretty well for now.
To solve everyone's problems in this thread, I wrote this: https://github.com/whizzzkid/instagram-reverse-proxy
It provides all of instagram's public data using the following endpoints:
Get user media:
https://igapi.ga/<username>/media
e.g.: https://igapi.ga/whizzzkid/media
Get user media with limit count:
https://igapi.ga/<username>/media?count=N // 1 < N < 20
e.g.: https://igapi.ga/whizzzkid/media?count=5
Use JSONP:
https://igapi.ga/<username>/media?callback=foo
e.g.: https://igapi.ga/whizzzkid/media?callback=bar
The proxy API also appends next page and previous page URLs to the response so you do not need to calculate that at your end.
Hope you guys like it!
Thanks to @350D for spotting this :)
The Instagram API requires user authentication through OAuth to access the recent media endpoint for a user. There doesn't appear to be any other way right now to get all media for a user.
If you are looking for a way to generate an access token for use on a single account, you can try this -> https://coderwall.com/p/cfgneq.
I needed a way to use the instagram api to grab all the latest media for a particular account.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With