whizzzkid / instagram-proxy-api

CORS compliant API to access Instagram's public data

Home Page:https://nishantarora.in/building-your-image-gallery-using-public-instagram-API.naml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No longer works

egfx opened this issue · comments

commented

https://igpi.ga/whizzzkid/media/?__a=1

{"error":"Denying request from referer: undefined"}

same for me, any advice?

Probably because this has also stopped working 😭
https://www.instagram.com/whizzzkid/media/

got it, do you know of any alternative?

commented

nope! There goes my app ;\

There goes everything we've worked for. I already updated the readme yesterday, IG disabled media queries. However the advanced params still work, but pagination is difficult. I have a solution in mind but I will be working on it over the weekend.

https://igpi.ga/username/media/?__a=1 gives the same mistake referrer undefined. Hope you`ll come up with some solution.

@yashkovskiy you're confusing between two problems.

Problem 1: Instagram disabled all media queries, i.e. any request with /media in them resolves to 404. For which you can use the advanced params.

Problem 2: As mentioned in issue #14 denying requests with undefined referrers is a feature I introduced to prevent abuse. Which means it will work fine with links from a web page or in your app. Try clicking this: https://igpi.ga/whizzzkid/?__a=1

does this makes it clear?

@whizzzkid
2017-11-08_15-10-34
your link gives me the same result in google chrome browser (see screenshot), as well as all other requests from my app. I`m using PHP and curl to make a request.

You need to understand how referrers work. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer

A quick primer, whenever you click a link or a script calls a url from a page, browser automatically appends the referrer parameter to the request, which implies if you're typing a link in your url then the browser has no referrer to send and it will hence be undefined.

e.g. clicking all the links below will work, copy pasting them into address bar won't.

Does that make sense?

Oh wait, my mistake sorry! Just needed to change the URL.

I guess another disadvantage of this alternative is that if the media is a video, it does not include a the URL of the video file.

@whizzzkid it does make sense, but for some reason when making a request from my server`s script I still get undefined :( it just a cron script on my web hosting, how to fix it, do you know?

Hey whizz,

As I mentioned days ago, your work is fucking amazing. I know that the ig messed it up, but please keep up with this project, it's the only one with that focus, it's amazing man...

@whizzzkid it does make sense, but for some reason when making a request from my server`s script I still get undefined :( it just a cron script on my web hosting, how to fix it, do you know?

@yashkovskiy this is the exact abuse I wanted to stop. The purpose of this proxy was to provide instagram's public data in a cors compliant method so that personal blogs/websites could use this to show their instagram posts. If you just wanted to your server to scrape instagram then you can hit the instagram api directly and it should be fine, you don't need a proxy. Not only will it be faster, but also help reduce loads on my server.

Does that make sense?

@whizzzkid thanks for your work here!

What is the call to the Instagram API you'd recommend servers make now that /media isn't working? I tried the url below, doesn't work:

https://www.instagram.com/kimkardashian/media/?__a=1

@shefaligupta thanks for the suggestion, I did try the above, however, /media had pagination functionality and the above only permits a single page (to my knowledge). What parameters (if any) can be used to add pagination?

Also - does anybody know where these API's are documented, if at all?

@axpence you tried opening it from your email. It will give you this error. the workaround is live on my website https://nishantarora.in/ check it out there.

commented

Here is my experience:

Clicked link from github notification email: error
Direct copy and paste: error
Clicked link from this thread: works

This is great. Thanks for your hard work on this!

@whizzzkid where did you find the documentation for the /graphql/query/ API?

I see that variables=%7B%22id%22%3A%221606740656%22%2C%22first%22%3A3%2C%22after%22%3A%22%22%7D when url_decoded becomes: variables={"id":"1606740656","first":3,"after":""}. I'd love to understand how to hit this API directly and what the paramaters mean. Thanks!

@axpence please open a different issue as question for this one.

Turns out this implementation takes just half the time as before, on my own website, the average loading time for the response is 149ms vs 290ms before. The most probable reason is, earlier loading a response with 20 results and then stripping them down to the count was an overhead which we do not need to deal with anymore.

Hey, I think the proxy isn't working anymore. I'm getting the following error when I follow this link in your readme "https://igpi.ga/whizzzkid/media?count=3"

The error:
{"code":2,"desc":"Failed to fetch from Instagram.","info":"encountered: TypeError: Cannot read property 'user' of undefinedfetched:{"message": "forbidden", "status": "fail"}"}