Hi everyone! 👋 In my book (Practical Python Projects), I initially had a section showing the readers how to upload stories on Instagram in an automated fashion. I ended up removing the code from the last draft of the book for various reasons. During the span of a few months, the library I was using to post on Instagram was removed from GitHub.
Just because this is not an officially supported feature by Instagram and the third-party libraries on GitHub come and go every couple of months, I decided not to add the code for automation in the book that is tied to any such third-party library. Just because I had initially advertised that I will show you how to upload stories to Instagram in the book, I decided to post the redacted part of the chapter on my blog.
To upload the stories on Instagram, we need to either reverse engineer Instagram API ourselves or use an already existing library. I searched on Google for Instagram API in Python. What I ended up learning was that there is no actively maintained official Python API. I decided to use this unofficial API (this library has been taken down now). I searched around to check if there was a story upload function/method somewhere. My search led me to this closed pull request. The author of the pull request had closed it before it got merged with the source repo. I ended up downloading (cloning) the repository and made the required changes (by following the afore-mentioned PR) to make the story feature working.
#python #instagram