Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.
Tanuj Nagpal edited this page Aug 26, 2019 · 2 revisions

Welcome to the instagram-api wiki!

Why?

I and a friend of mine were working on a project which required user(s) instagram data to generate insights on it. First we started off looking up for a kind of official API but there was not any at the moment there were in past but are deprecated now. So we just couldn't stop the development of that project and thought of a way out. First I tried conventional node.js scrapping tools which didn't work because of the fact that instagram is a single page application. Then we implemented a bot of sorts which worked on the top of a headless browser you can checkout the source code here which is not a very good implementation because it was slow for obvious reasons. We were kind of satisfied with it because we had to scrap the data once a month anyway so the speed wouldn't matter. Now version 2 is whole new implementation check it out here. So I decided to make it my first proper open source software

What?

This API is kind of a workaround and is unofficial which provides various information about any Instagram's user whose account is public. Information consists

  • Profile picture URL in HD
  • Latest ~12 posts infomation(Likes,Comments,Image HD URL,Image thumbnail URL etc.)
  • #follwers,#following etc.

How?

I was just analyzing the HTML page of a user and made a fetch request on the browser itself first to see what I actually get in that html. There I noticed traces of data in a JSON format in a very unordered manner. This was the key. I use axios to make an HTTP GET request to the profile first. With the help of JSDom I parse the html page and execute the javascript in node environment itself and keep fitting the data to the result in a simple way.

Clone this wiki locally