This builds over the Instagram's public API to provide more functionality and provides a CORS complaint reverse instagram proxy service. Try Here: https://igpi.ga/whizzzkid/media/?count=3
A user's public data on Instagram can be accessed on
https://www.instagram.com/<user>/media/ but there are are a lot of problems with this service.
As of now, the service is running on https://igpi.ga/(Heroku) I am not aware about limits, it's basically running on free tier. If it hits any limit, I'll have to figure that out. But the intended use is to replace
Getting Instagrams's data as is. The following will give you access to the same data instagram provides.
Limiting the amount of images to be sent.
Using pagination: Each response has url links to the next and previous page, you can use that to traverse through the results.
You just need to replace
https://igapi.ga/ and everything should just work as is.
NO AUTH REQUIRED, that's the best part, you can access all of instagram's public data without authentication or registering an app. Private data returns nothing. However private data maybe accessible using instagram's api if the user is logged in.
# The following returns data *only* if the user is logged in. https://www.instagram.com/<private_user>/media/ # The following will always return nothing for private users. https://igpi.ga/<private_user>/media/
Clone the repo and change to the cloned directory. Run:
$ npm install $ npm run dev
To run prod instance, run:
$ npm run prod
The idea came into being after reading some discussion here.
The logs have gone wild, the sheer number of requests are amazing for this service is running on the free heroku tier. In the last 30 days we have serviced more than 300,000 requests to this API. Check this graph out:
At first I was surprized with this number and was inclined towards thinking that someone was trying to scrape instagram using this API. Turns out I was wrong, a really popular asian website is using this service on their website. I am in talks with them to move this traffic to a dedicated separate instance of this service.
OMFG, this shit just got out of hand:
Both production urls igapi.ga nd igpi.ga will no longer serve content to
undefined referers. Your requests will need to explicitly provide referer meta data in the headers. If you're using this service on your website, your browser will automatically handle this, so no change will be required on your part.
Instagram seems to have patched the media endpoints and now they resolve to 404-pages, however the advanced params still work as of now. So in short, instead of using https://igpi.ga/whizzzkid/media/?count=3 (which won't work) use https://igpi.ga/whizzzkid/?__a=1 and get the data from user.media.nodes object. I'll try figuring the solution around to this.
I am trying to query instagram's GQL servers to rebuild responses. These can be accessed like: https://igpi.ga/graphql/query/?user_id=<user_id>&count=<post_count>. e.g. https://igpi.ga/graphql/query/?user_id=1606740656&count=3
User id can be found here: https://www.instagram.com/whizzzkid/?__a=1 I'll be working on extracting this next.
The workaround implemented by hacking the GQL queries seems effective. The proxy has been running smooth, so I proted the old endpoints to utilize this. It's undertstandable that this will take twice as longer. But again, it works!
Since, IG disable
/media urls, undefined referrers will be enabled for a while for perople to test this out.
All contributers are welcome, feel free to report issues and send PRs
Source Code: GPLv3
Service hosted on https://igpi.ga or https://igapi.ga or any heroku instance used in running these services, will be free only for personal use (i.e. personal blogs/personal websites/personal portfolios). If any other entity intends to use this service for any other purpose, please send an email to firstname.lastname@example.org to discuss more about this (Please include your domain, expected traffic and purpose). Failing to do so will lead to blacklisting from this service.