I am working on a web app in which some content is generated in the form of text (and will soon include images as well). I want to add a share button which will allow the user to add this content to their Instagram story.
So the flow of this is going to be:
- User does something on the website
- The website generates some content based on user input
- User clicks on “Share on Instagram” and posts it on his/her story
Is there a way to do this using Javascript or an API call like the Twitter share option directly from the HTML ?
I am using Python on the backend (Flask) and JS on the frontend
2
Answers
OK, lets make this simple.
The direct answer as found on the official Facebook developers page is no. You can’t trigger an API to create an instagram story, as for now only the "read-mode" is supported through API.
But as most things in life you can hack your way around.
You can create a button that says, "share on your instagram stories" and here’s what it is gonna do:
UPDATE
There is a better solution for the third point:
It goes without saying that this will work when the website is opened in a phone and not in a desktop browser as in desktop you can’t post stories.
The New York Times has done this.
In iOS, it generates an Instagram Story, with the headline and lede of the respective news article.
To do this, you’ll have press the "share" button on an iPhone and then "Instagram Stories."
Auto generated Instagram Story, via The New York Times iOS app
Twitter has also done this for quite a while.