Back to directory
yuvraj108c avatar

instagram-publisher

Publish Instagram Images, Slideshows, Video Reels & Stories via NodeJS (No API key required). Read more below about its uses, features, and usage.

Clone repository

git clone https://github.com/yuvraj108c/instagram-publisher.git

55

Stars

5

Forks

3

Watchers

MIT

License

NPM Version NPM Downloads Issues

Instagram Publisher

  • Publish Instagram Images, Slideshows, Video Reels & Stories via NodeJS.
  • Supports Geotagging
  • Supports Cookies Caching
  • No API key required

Install

npm install instagram-publisher

Import

import InstagramPublisher from 'instagram-publisher'; // ES module

const InstagramPublisher = require('instagram-publisher'); // commonJS

Authentication ๐Ÿ”’

const client = new InstagramPublisher({
  email: '[email protected]',
  password: '12345',
  verbose: true, // default: false
});

Create Image Post ๐Ÿ–ผ๏ธ

const image_data = {
  image_path: './a.jpg',
  caption: 'Image caption',
  location: 'Chicago, United States', // optional
};
const post_published = await client.createSingleImage(image_data);

Create Image Slideshow ๐Ÿ–ผ๏ธ๐Ÿ–ผ๏ธ๐Ÿ–ผ๏ธ

const slideshow_data = {
  images: ['./a.jpg', './b.jpg'],
  caption: 'Slideshow caption',
  location: 'Chicago, United States', // optional
};
const post_published = await client.createImageSlideshow(slideshow_data);

Create Image Story ๐ŸŽจ

const story_data = {
  image_path: './a.jpg',
};
const post_published = await client.createImageStory(story_data);

Create Video Post ๐Ÿ“ท

const video_data = {
  video_path: './video.mp4',
  thumbnail_path: './thumbnail.jpg',
  caption: 'Video Post caption',
  location: 'Chicago, United States', // optional
};

const post_published = await client.createSingleVideo(video_data);

Create Reel ๐Ÿ“ท

const reel_data = {
  video_path: './video.mp4',
  thumbnail_path: './thumbnail.jpg',
  caption: 'Reel caption',
  location: 'Chicago, United States', // optional
};

const post_published = await client.createReel(reel_data);

Getting URL's of posts ๐Ÿ”—

All methods return an object with the published post code: { succeeded: true, code: 'CrfNdfjdsfsl' }. You can generate the URL's as follows:

Important Notes โš ๏ธ

  • Maximum images per slideshow: 10
  • Minimum images per slideshow: 2
  • Supported images format: .jpg
  • Supported aspect ratio for slideshow images: 1:1
  • Supported video aspect ratio: 1:1, 9:16, 16:9
  • Supported video formats: .mp4
  • Maximum caption length: 2200 characters
  • URL's are not supported. Use local files only
  • Cookies are cached under cookies.json
  • Videos take some time to be published (< 60 seconds)
  • Enable logging by setting verbose flag to true

Inspiration

License

MIT

Releases

Apr 19, 2023

v2.3.0

Download .zip

What's Changed

Return URLs (as codes) for posts, and fix issue when ffprobe doesn't know the aspect ratio by @dashcambike in #3

New Contributors

@dashcambike made their first contribution in #3

Fu...

Mar 14, 2023

v2.2.0

Download .zip

What's changed?

[Feature] Geotagging for image/videos/reels/slideshows [Feature] Create Image Stories [Fix] Removed aspect ratio restriction for single image posts

Full Changelog: 2.1.1...2.2.0

Dec 13, 2022

v2.1.1

Download .zip

What's changed?

Fix login issue caused by outdated regexp Fix fs module import bug

Full Changelog: v2.1.0...v2.1.1

Sep 12, 2022

v2.1.0

Download .zip

What's changed?

Create Reels (different from video post) Removed useragent-from-seed dependency Check expiration date during cookies validation Display whether cached cookies are being used or not Di...

Jun 13, 2022

Version 2.0.0

Download .zip

What's changed?

[feature] Create single image posts Massive code refactoring Changed code for image upload Fix typings for better intellisense Support esmodule & commonjs imports

Full Changelog: v1....