All Projects → webistomin → nanogram.js

webistomin / nanogram.js

Licence: MIT license
📷 An easy-to-use and simple Instagram package that allows you to fetch media content without API and access token.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to nanogram.js

insta-story
🤖 📷 Instagram Story Downloader Anonymously - PHP
Stars: ✭ 25 (-59.68%)
Mutual labels:  instagram-feed, instagram-scraper, instagram-api, instagram-photos, instagram-downloader
Instagram-Auto-Pilot
Automate common Instagram activities such as following, unfollowing, commenting and reposting images from instagram accounts.
Stars: ✭ 50 (-19.35%)
Mutual labels:  instagram-feed, instagram-scraper, instagram-api, instagram-photos, instagram-downloader
instagram
Php instagram library. With this library, you can use many of the same features in the mobile application.
Stars: ✭ 45 (-27.42%)
Mutual labels:  instagram-feed, instagram-scraper, instagram-api, instagram-photos, instagram-downloader
Instaloader
Download pictures (or videos) along with their captions and other metadata from Instagram.
Stars: ✭ 3,655 (+5795.16%)
Mutual labels:  instagram, instagram-feed, instagram-scraper, instagram-photos, instagram-downloader
Instagram-to-discord
Monitor instagram user account and automatically post new images to discord channel via a webhook. Working 2022!
Stars: ✭ 113 (+82.26%)
Mutual labels:  instagram, instagram-scraper, instagram-photos, instagram-downloader
instastory.js
This is a jQuery plugin to make it easy to get a feed from instagram. No need of access tokens and other stuff, Only thing needed is jQuery.
Stars: ✭ 36 (-41.94%)
Mutual labels:  instagram, instagram-feed, instagram-scraper, instagram-photos
jekyll-instagram
A Jekyll plugin for displaying your recent Instagram photos
Stars: ✭ 24 (-61.29%)
Mutual labels:  instagram, instagram-feed, instagram-api, instagram-photos
Instagram-Scraper-2021
Scrape Instagram content and stories anonymously, using a new technique based on the har file (No Token + No public API).
Stars: ✭ 57 (-8.06%)
Mutual labels:  instagram, instagram-feed, instagram-scraper, instagram-api
Instauto
Simple to use wrapper around the private Instagram API, written in Python.
Stars: ✭ 52 (-16.13%)
Mutual labels:  instagram, instagram-scraper, instagram-api
Instagram Scraper
Scrapes an instagram user's photos and videos
Stars: ✭ 5,664 (+9035.48%)
Mutual labels:  instagram, instagram-scraper, instagram-api
Igql
Unofficial Instagram GraphQL API to collet data without authentication
Stars: ✭ 80 (+29.03%)
Mutual labels:  instagram, instagram-scraper, instagram-api
Socialmanagertools Igbot
🤖 📷 Instagram Bot made with love and nodejs
Stars: ✭ 699 (+1027.42%)
Mutual labels:  instagram, instagram-scraper, instagram-api
Instabotai
Instagram AI bot with face detection. It works without instagram api, need only login and password.
Stars: ✭ 181 (+191.94%)
Mutual labels:  instagram, instagram-scraper, instagram-api
Instagramapisharp
A complete Private Instagram API for .NET (C#, VB.NET).
Stars: ✭ 486 (+683.87%)
Mutual labels:  instagram, instagram-scraper, instagram-api
Inwidget
inWidget - free Instagram widget for your website. Allows you to show photos from an Instagram account, by hashtags and more.
Stars: ✭ 132 (+112.9%)
Mutual labels:  instagram, instagram-scraper, instagram-api
instagram-token-agent
A service to keep your Instagram Basic Display API token fresh.
Stars: ✭ 118 (+90.32%)
Mutual labels:  instagram, instagram-api, instafeed-js
Socialmanagertools Docs
📚 Documentation of Social Manager Tools
Stars: ✭ 151 (+143.55%)
Mutual labels:  instagram, instagram-scraper, instagram-api
Instagram Proxy Api
CORS compliant API to access Instagram's public data
Stars: ✭ 245 (+295.16%)
Mutual labels:  instagram, instagram-scraper, instagram-api
Instasharper
Private Instagram API
Stars: ✭ 426 (+587.1%)
Mutual labels:  instagram, instagram-scraper, instagram-api
Instagram User Feed
This is a scrapper to easily fetch any feed and interact with Instagram (like, follow, etc.) without OAuth for PHP.
Stars: ✭ 435 (+601.61%)
Mutual labels:  instagram, instagram-scraper, instagram-api

Nanogram


An easy-to-use and simple Instagram package allows you to fetch media content without API and access token.

⭐️ Star me on GitHub — it helps!

GitGub Actions codecoverage CodeFactor GitHub issues GitHub last commit npm type definitions npm bundle size

npm downloads jsdeliver contributors

WarningKey FeaturesDemoDocumentationInstallationHow To UseCaveatsBrowsers supportLicenseContributing

Warning

Instagram has introduced a strict-origin-when-cross-origin policy since February 2021. So they don't allow cross-site content access anymore. For now, I am not sure how to solve this issue.

Key Features

  • Small. ~ 2KB (minified and gzipped). Size Limit controls the size
  • No dependencies
  • No need for the access token secret
  • Easy to use
  • Typescript support
  • Tree shakeable

Demo 👀

DEMO

Documentation 🔨

You can read the full documentation here

Installation 🚀

Using package managers

npm

$ npm install nanogram.js --save

yarn

$ yarn add nanogram.js

via CDN

Add script right before closing </body> tag

<script src="https://unpkg.com/[email protected]/dist/nanogram.iife.js"></script>
or
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/nanogram.iife.js"></script>

Hint: for a better performance add preconnect link in the head of your document.

<head>
  <!-- for unkpg cdn --> 
  <link rel="preconnect" href="https://unpkg.com">

  <!-- for jsdelivr cdn -->
  <link rel="preconnect" href="https://cdn.jsdelivr.net">  


  <!-- dns-prefetch only for IE11 --> 
  <!--	<link rel="dns-prefetch" href="https://unpkg.com"> -->
  <!--	<link rel="dns-prefetch" href="https://cdn.jsdelivr.net"> -->
</head>

How to use 🤔

Get media content by providing instagram username

ES2015

import { getMediaByUsername } from 'nanogram.js'

getMediaByUsername('instagram').then((media) => {
  console.log(media);
});

CommonJS

const getMediaByUsername = require('nanogram.js').getMediaByUsername;

getMediaByUsername('instagram').then((media) => {
  console.log(media);
});

IIFE

const getMediaByUsername = window.Nanogram.getMediaByUsername

getMediaByUsername('instagram').then((media) => {
  console.log(media);
});

Note: get content from user page. 12 photos is the maximum for this method.


Get media content by providing instagram post id

ES2015

import { getMediaByPostId } from 'nanogram.js'

getMediaByPostId('CIrIDMtDwn4').then((media) => {
  console.log(media);
});

CommonJS

const getMediaByPostId = require('nanogram.js').getMediaByPostId;

getMediaByPostId('CIrIDMtDwn4').then((media) => {
  console.log(media);
});

IIFE

const getMediaByPostId = window.Nanogram.getMediaByPostId

getMediaByPostId('CIrIDMtDwn4').then((media) => {
  console.log(media);
});

Note: get content from post page


Get media content by providing instagram reel id

ES2015

import { getMediaByReelId } from 'nanogram.js'

getMediaByReelId('CKONdDkJaPU').then((media) => {
  console.log(media);
});

CommonJS

const getMediaByReelId = require('nanogram.js').getMediaByReelId;

getMediaByReelId('CKONdDkJaPU').then((media) => {
  console.log(media);
});

IIFE

const getMediaByReelId = window.Nanogram.getMediaByReelId

getMediaByReelId('CKONdDkJaPU').then((media) => {
  console.log(media);
});

Note: get content from reel page


Get media content by providing instagram tag

ES2015

import { getMediaByTag } from 'nanogram.js'

getMediaByTag('sunset').then((media) => {
  console.log(media);
});

CommonJS

const getMediaByTag = require('nanogram.js').getMediaByTag;

getMediaByTag('sunset').then((media) => {
  console.log(media);
});

IIFE

const getMediaByTag = window.Nanogram.getMediaByTag

getMediaByTag('sunset').then((media) => {
  console.log(media);
});

Note: get content from tag page


Get media content by providing location id and place name

ES2015

import { getMediaByLocation } from 'nanogram.js'

getMediaByLocation(6264386, 'highbridge-park').then((media) => {
  console.log(media);
});

CommonJS

const getMediaByLocation = require('nanogram.js').getMediaByLocation;

getMediaByLocation(6264386, 'highbridge-park').then((media) => {
  console.log(media);
});

IIFE

const getMediaByLocation = window.Nanogram.getMediaByLocation

getMediaByLocation(6264386, 'highbridge-park').then((media) => {
  console.log(media);
});

Note: get content from location page


Get all available countries

ES2015

import { getCountries } from 'nanogram.js'

getCountries().then((media) => {
  console.log(media);
});

CommonJS

const getCountries = require('nanogram.js').getCountries;

getCountries().then((media) => {
  console.log(media);
});

IIFE

const getCountries = window.Nanogram.getCountries

getCountries().then((media) => {
  console.log(media);
});

Note: get countries from location page


Get all cities by providing country id

ES2015

import { getCitiesByCountryId } from 'nanogram.js'

getCitiesByCountryId('US').then((media) => {
  console.log(media);
});

CommonJS

const getCitiesByCountryId = require('nanogram.js').getCitiesByCountryId;

getCitiesByCountryId('US').then((media) => {
  console.log(media);
});

IIFE

const getCitiesByCountryId = window.Nanogram.getCitiesByCountryId

getCitiesByCountryId('US').then((media) => {
  console.log(media);
});

Note: get cities from country page


Get all places by providing city id

ES2015

import { getPlacesByCityId } from 'nanogram.js'

getPlacesByCityId('c2728325').then((media) => {
  console.log(media);
});

CommonJS

const getPlacesByCityId = require('nanogram.js').getPlacesByCityId;

getPlacesByCityId('c2728325').then((media) => {
  console.log(media);
});

IIFE

const getPlacesByCityId = window.Nanogram.getPlacesByCityId

getPlacesByCityId('c2728325').then((media) => {
  console.log(media);
});

Note: get places from city page


Get media content by providing place id

ES2015

import { getMediaByPlaceId } from 'nanogram.js'

getMediaByPlaceId(2999512).then((media) => {
  console.log(media);
});

CommonJS

const getMediaByPlaceId = require('nanogram.js').getMediaByPlaceId;

getMediaByPlaceId(2999512).then((media) => {
  console.log(media);
});

IIFE

const getMediaByPlaceId = window.Nanogram.getMediaByPlaceId

getMediaByPlaceId(2999512).then((media) => {
  console.log(media);
});

Note: get content from place page


Get media content by providing search query

ES2015

import { getMediaBySearchQuery } from 'nanogram.js'

getMediaBySearchQuery('sunset').then((media) => {
  console.log(media);
});

CommonJS

const getMediaBySearchQuery = require('nanogram.js').getMediaBySearchQuery;

getMediaBySearchQuery('sunset').then((media) => {
  console.log(media);
});

IIFE

const getMediaBySearchQuery = window.Nanogram.getMediaBySearchQuery

getMediaBySearchQuery('sunset').then((media) => {
  console.log(media);
});

Note: get content from searchbar on the top of the page


Caveats 💣

How to get next page? There are only 12 photos
12 photos is the maximum. I think there is no way to load more content. Use instafeed.js with access_token to load more items.
Nanogram stopped working (Cannot read property '0' of undefined)
Perhaps you made a large number of requests in a short period of time. There is a limit. Usually, the duration of a temporary Instagram ban ranges from few hours to 24-48 hours. The duration of ban also depends on your follow up actions. If you would continue doing the wrong actions, the ban may prolong.

Browsers support 🌎

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
iOS Safari
iOS Safari
Opera
Opera
Yandex
Yandex
IE11*, Edge 12+ 27+ 32+ 7.1+ 8+ 19+ 14.2+

* – For IE11 you need to install a Promise polyfill.

If you are using version less than 2.0.0 you will also need polyfill for Fetch API.

If you want maximum browser compatibility, please use polyfills.

See caniuse for promise.

Browsers polyfills

If you want to send a polyfill only to browsers that need it, there's a handy service called Polyfill.io which does just that, it offers a wide array of polyfills.

Here's an example of using polyfill.io to polyfill only the Promise feature, so if we put this right before closing </body> tag of index.html and Nanogram.js script, Polyfill.io will read the user agent and use that information to determine if the browser requires a polyfill for the feature or features listed. Since I'm using Chrome it will send back an empty response since my browser doesn't need it, pretty slick.

<script src="https://polyfill.io/v3/polyfill.min.js?features=Promise"></script>

Alternatively, you can install packages like es6-promise.

Node.js

Node.js doesn't have a built-in implementation of the XHR API, but you can use any library with a compatible interface, such xmlhttprequest.

If you are using version less than 2.0.0 you need Fetch API instead of XHR API. Such node-fetch.

License 📄

MIT

Contributing 🎉

Found a bug? Missing a specific feature? Your contributions are always welcome! Please have a look at the contribution guidelines first.

Contributors

Thanks goes to these wonderful people (emoji key):


Alexey Istomin

🚇 💻 🤔

Yousuf Khan

💻 ⚠️ 🐛

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].