Closed tarangpatel61 closed 5 years ago
Hello rhcarlosweb Here i getting the error when i hit below link https://instagram.com/graphql/query/?query_id=17888483320059182&id=44291&first=30&after= It gives error Access to instagram.com was denied You don't have authorization to view this page. HTTP ERROR 403
You need to be logged in/authenticated
Thank you its works fine!!!!!
@despecial is there a way to do it without authentication?
@Saiirex only if you scrape the normal profile page and extract the JSON array. (You will get the latest 12 medias, nothing else)
@despecial thats sad, i need all the media...
Then use the official API
Which one? Graph api?
@Saiirex https://developers.facebook.com/docs/instagram-api but you can't access the account without access token ,and must be business account
So its official then.. anonymous scrapping is no longer possible without Instagram's own business account API.
@itzfaraz Well that's a pitty, any chances in loading the userpage and actually retreiving all the objects?
As already pointed out by many people, the Instagram has changed its API once again; it is now mandatory to work with all cookies that are returned on the first contact with www.instagram.com/{username}
. But the bigger problem is query_hash
code that has become IP and device specific and keeps changing on every session (I think). I've been able to dig down to a JavaScript file that is from https://www.instagram.com/static/bundles/base/ProfilePageContainer.js/{randomcode}.js
which contains the query_hash code every time you create a new session. Even that file has 3 different query_hash code, not sure which one the scrapper should pick up for communication.
But keep in mind.. if your incognito/private mode web browser can communicate with Instagram without any user login, so can your application. Just need to figure out how to do it.
Instagram has made it's code very dynamic. The CSS stylesheets, linked files, script files, hash codes, etc. everything differs from session to session.
@itzfaraz is there a working solution right now?
@itzfaraz @despecial @Saiirex I implement a way to fetch user feed without authentication using web scraping here : https://github.com/pgrimaud/instagram-user-feed.
How it works? I retrieve the mandatory parameters x-instagram-gis and update it after each call. With this parameter, paginate is working properly.
You can see an example here : https://github.com/pgrimaud/instagram-user-feed/blob/master/examples/medias.php
Hope it helps
@pgrimaud Apologies Ive been busy elsewhere. Yes it works brilliantly. Thanks a lot. Good job.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
325