Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/orsifrancesco/instagram-without-api-node

A simple Node.js code to get unlimited instagram public pictures by every user without api, without credentials.
https://github.com/orsifrancesco/instagram-without-api-node

instagram instagram-api instagram-scraper node node-js nodejs scraper scraping scraping-api without-api

Last synced: 3 months ago
JSON representation

A simple Node.js code to get unlimited instagram public pictures by every user without api, without credentials.

Awesome Lists containing this project

README

        

# ⛔️ DEPRECATED

Instagram moved the pictures array to another endpoint (with more than one redirect) making harder to catch images server side without scrapers like [Puppeter](https://pptr.dev/).

Althought is not perfect sniffagram (as a temporary solution) works.

Maybe in the future I will share a new version, but judging by the many demands without any kind of gratitude and collaboration from the community, I have lost the desire.



instagram-without-api


Instagram Without APIs


Instagram Scraping (@users and #tags) in April 2023, no credentials required


This is a Node.js library, are you looking for the same in PHP? go to https://orsi.me/instagram-without-api/.

A simple Node.js code to get **unlimited instagram public pictures** by **every user** without api, **without credentials** (just token from cookies), just Instagram Scraping in 2023 (with cookie and image data in base64).

You can get the latest pictures/information from an account or a single picture/information by id.

### [📦 npm link](https://www.npmjs.com/package/instagram-without-api-node)
### [🛕 Cool Project Example](https://orsi.me/sniffagram) sniffagram
### [🎮 Demo / Example](https://orsifrancesco.github.io/instagram-without-api/how-to-show-base64-images.html)
### ⚖️ Licensed under MIT
### 🤓 Author [@orsifrancesco](https://twitter.com/orsifrancesco)
### ☕ [Coffees are welcome](https://www.paypal.com/donate/?business=5EL4L2LDYVH96) (in particular if you appreciate the project or you plan to contact me)


## 📦 Installation

```bash
npm i instagram-without-api-node

# download the file https://github.com/orsifrancesco/instagram-without-api-node/blob/master/test.js
# add your cookie, user-agent and x-ig-app-id following the next step "How to get Instagram Cookie"

node test.js
```

## 🍪 How to get Instagram Cookie

- Login to Instagram
- Go to your https://instagram/yourUsername
- Open your Browser Console (on Chrome just pressing F12)
1. Select the "Network" tab
2. Search and click on "timeline/" file; if it is empty just refresh the page
3. Select "Headers" bar
4. Be sure the file is Request Method "POST" (if it is "OPTIONS" search the other "timeline/" file in the list)
5. Scroll down and select "Request Headers" tab
6. Copy all the code after the word "cookie: " and paste it on `_cookie` variable
7. Copy all the code after the word "user-agent: " and paste it on `_userAgent` variable
8. Copy all the code after the word "x-ig-app-id: " and paste it on `_xIgAppId` variable
```diff
- don't share your cookie code with anyone!!! it is the same of your credentials
```
- That's it, enjoy :)

![follow this steps](https://user-images.githubusercontent.com/6490641/181632823-42fb2308-4c3f-421a-848a-58cefcf98915.png "follow this steps")

## 💻 Images Base64
Although you can get the URLs of the images, Instagram doesn't give you the possibility to include and showing those images on your projects (they will be automatically blocked from their servers).\
To solve this problem you will get all the URLs and all the images data in base64.\
You can easily show the image data on your project with the following snippets of code:

```html

```
```css
.example { background-image: url('data:image/jpg;base64, hereYourBase64String..'); }
```

Check https://orsifrancesco.github.io/instagram-without-api/how-to-show-base64-images.html for Base64 example.

## 🛕 Cool Project Example
![sniffagram](https://user-images.githubusercontent.com/6490641/232155875-ce2ea2ec-eeb5-4bcc-9af7-8c8d82887420.svg "sniffagram")

## 🎮 Demo / Example
example on https://github.com/orsifrancesco/instagram-without-api-node/blob/master/test.js

```js
const { iwaTag, iwa, iwaId, iwaIdUrl } = require('instagram-without-api-node');

const _cookie = 'mid=Ywj....hFLUdjNT55f0"' //