Skip to main content

🤖 Citato - Simple Instagram API

PyPI PyPI - Python Version Downloads

This package lets you use Instagram's Internal Web API through simple functions and classes. Citato 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 citato

To update the existing package, run:

$ pip install citato --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 citato 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 citato 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 citato import Guest

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

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

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.

Metadata

Release files for maximus 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maximus 1.0
File Size Uploaded Provenance Actions
maximus-1.0.tar.gz 16.6 kB Without provenance Details for maximus-1.0.tar.gz

Release files / maximus-1.0.tar.gz

Download URL maximus-1.0.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6f1cf57c00da1a225d465ebcb757bb22f4050ac1768d86c0175891e18e417816
BLAKE2b-256 checksum
How to use checksums
3bae547c6f5153dbf0146a3a1efb214fc03a8e10de4eaeb0b4a67e061aa6978f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for maximus 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page