dilame / instagram-private-api

NodeJS Instagram private API SDK. Written in TypeScript.
MIT License
5.99k stars 1.14k forks source link

Adding a link to an Instagram story using instagram-private-api #1724

Open dingrins opened 1 year ago

dingrins commented 1 year ago

Form

Put an [x] if you meet the condition, else leave [ ].

Question

A specific question, so it's understandable to anyone. You may add pictures.

I am trying to post a story with a link attached to it using the instagram-private-api library. I have been able to successfully post a story using the ig.publish.story method, but I am unsure how to attach a link to the story. Is it possible to add a link to a story using this library? If so, could you provide some guidance on how to achieve this?

Code

A meaningful section of your code (else delete this). If you are using TypeScript replace js with typescript.

const { IgApiClient } = require('instagram-private-api');
const ig = new IgApiClient();

async function login() {
  ig.state.generateDevice(process.env.IG_USERNAME);
  ig.state.proxyUrl = process.env.IG_PROXY;
  await ig.account.login(process.env.IG_USERNAME, process.env.IG_PASSWORD);
}

async function publishStory(imagePath, link) {
  await login();

  const publishedMedia = await ig.publish.story({
    file: fs.readFileSync(imagePath),
    stickerConfig: {
      link,
      linkType: 1,
      linkText: 'See More',
    },
  });

  await ig.media.configureStory({
    upload_id: publishedMedia.upload_id,
  });
}

publishStory('path/to/your/image.jpg', 'https://your-link.com');

Error and Output

There is no error, but the story is posted without the link.

matankila commented 1 year ago

hey i found that missing too!!! please add this feature!

wpadilla commented 11 months ago

This would be an incredible features for the library, react if you are waiting for it ❤️

vult22896 commented 11 months ago

i try add option link in PostingStoryOptions, so not working!

bsakizli commented 6 months ago

I'm waiting, will this be the process of adding links to the story side?

Kulunkulu commented 6 months ago

i'm also anticipating this feature Can i add links to stories via the Official Instagram API?

bondobrus commented 1 month ago

Anybody found a way to add story sticker? For me all type of stickers are not visible.

GBDev13 commented 3 weeks ago

any updates?