Skip to main content

🔥 Fastest & Simplest Python Package For Instagram Automation

Project description

🤖 Ensta - Simple Instagram API

PyPI PyPI - Python Version Downloads Twitter Share

This package lets you use Instagram's Internal Web API through simple functions and classes. Ensta uses Instagram's Original Web API to scrape data which makes it a reliable choice over other third-party scrapers. This library mainly focuses on Simplicity & Reliability.

Two type of classes are supported - Guest & Host.

📢 Announcements

[#02] AutoHost is released! Authentication update to the Host Class.

[#01] Users can now log in through their Username and Password to generate SessionId! See this

Installation

To install this package using Python's PIP, run this command in a terminal window:

$ pip install ensta

To update the existing package, run:

$ pip install ensta --upgrade

🧔🏻‍♂️ Guest Mode

This mode doesn't require login and can be used to fetch publicly available data from Instagram's Servers. Following methods are supported till now:

  • Check if username is available for registration
  • Fetch someone's profile data
  • Convert username to userid
  • Convert userid to username

Here's an example where an instance of Guest Class is created to fetch Cristiano Ronaldo's profile information:

from ensta import Guest

guest = Guest()
profile = guest.profile("cristiano")

if profile is None:
    print("Something went wrong.")
else:
    print(profile.biography)
    print(profile.follower_count)
    print(profile.following_count)

🧔🏻‍♂️ Host Mode

Host mode requires login through SessionID, which should be passed as an argument during initialization. It can be used to take actions that require login. Additionally, users can manage their own profile through this class.

These are the methods supported till now:

  • Check authentication status of the user
  • Follow/unfollow users
  • Fetch someone's follower/following list
  • Switch account type - 'Public' or 'Private'

Here's an example where an instance of Host Class is created to follow Cristiano Ronaldo's account:

from ensta import Host, NewSessionID

sessionid = NewSessionID("username", "password")

host = Host(sessionid)
status = host.follow("cristiano")

if status is None:
    print("Something went wrong.")
else:
    if status.following:
        print("Following!")
    
    elif status.follow_requested:
        print("Requested to follow!")

Note:

When you create a new sessionid through NewSessionID(), it's recommended to save it somewhere, and use the same sessionid (instead of creating a new one each time you need) until it expires or becomes invalid.

This should be done to avoid unnecessary prolonged wait time while generating a new sessionid and also to prevent getting your account from getting flagged because of repetitive logins.

📋 Remember

Every function should return None on failure. So, it's recommended to add an if statement before using the actual data to avoid TypeErrors. Here's an example:

from ensta import Guest

guest = Guest()
available = guest.username_availability("cristiano")

if available is None:  # 'None' indicates failure
    print("Something went wrong.")
else:
    print(available)

❤️ Donate

If you wish to help me in the development of Ensta, consider donating:

Disclaimer

This is a third-party package, and not approved by Instagram. It doesn't promote illegal activities or activities that violate Instagram's Community Guidelines such as spamming users, creating bot accounts, misusing data etc. You are solely responsible for all the actions you take using this package.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ensta-3.1.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ensta-3.1-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file ensta-3.1.tar.gz.

File metadata

  • Download URL: ensta-3.1.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for ensta-3.1.tar.gz
Algorithm Hash digest
SHA256 05d9fbccfec37622ae652404fdc548130eddedb1e0e770b499faf35df790a0e6
MD5 68d86962a2095a3079f27b8cc48fe5b1
BLAKE2b-256 8bd8741575db4dee441e4c470e53946ee93c20de725945088be4507737f151dc

See more details on using hashes here.

File details

Details for the file ensta-3.1-py3-none-any.whl.

File metadata

  • Download URL: ensta-3.1-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for ensta-3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 782f8806f9f361d7e198a698036a158915115f9e042e4d994972d08b0e5d8454
MD5 4c1718feb67b057fe8524666a7e6f5a3
BLAKE2b-256 b07e35430d1666b35fd2080dd97078d516f710cf62bb60f5877e597a82bad48a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page