Search code examples
pythonfacebookoauthinstagram

How to remove my own instagram followers with Python?


I want to remove my own instagram followers without blocking them, using python.

I have seen many, many, many, many instagram python libraries online that allow you to stop or start following a person, but that is not what I'm looking for; I don't want to remove who I am following or start following someone, I want to remove people who are following me.

I looked into the official documentation of Instagram's HTTP API trying to make my own solution, but I couldn't find the documentation of this action under any endpoint ( I assume it should be under /friends/ ).

I vaguely remember some library that used to do this, but I cannot find it. Does anyone know of a good way to achieve this, preferably via passing an inclusion/exclusion list for the followers I want to have as a result?


Solution

  • I found a solution in an old library that does something similar. You can't directly remove followers through most tools, but if you block and then unblock a user, the effect you want is achieved. Example code:

    # https://instagram-private-api.readthedocs.io/en/latest/_modules/instagram_private_api/endpoints/friendships.html
    import instagramPrivateApi
    # ...
    # Implement a Client class that inherits FriendshipMixin
    api = new Client()
    api.friendships_block(uid)
    api.friendships_unblock(uid)