instagram-private-api
instagram-private-api copied to clipboard
Adding a link to an Instagram story using instagram-private-api
Form
Put an [x]
if you meet the condition, else leave [ ]
.
- [ X ] I've searched the Issues
- [ X] I've read the basic concepts
- [ X] I'm using the latest version
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.
hey i found that missing too!!! please add this feature!
This would be an incredible features for the library, react if you are waiting for it ❤️
i try add option link in PostingStoryOptions, so not working!
I'm waiting, will this be the process of adding links to the story side?
i'm also anticipating this feature Can i add links to stories via the Official Instagram API?