• Stars
    star
    2,476
  • Rank 18,568 (Top 0.4 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🔥 The fastest and powerful Python library for Instagram Private API 2023

Package PyPI PyPI - Python Version Checked with mypy

Downloads Downloads Downloads

Donate

If you are tired of being blocked when receiving data from Instagram, I recommend using our service - Lamadava SaaS and Datalama SaaS

Features:

  • Getting public data of user, posts, stories, highlights, followers and following users
  • Getting public email and phone number, if the user specified them in his business profile
  • Getting public data of post, story, album, Reels, IGTV data and the ability to download content
  • Getting public data of hashtag and location data, as well as a list of posts for them
  • Getting public data of all comments on a post and a list of users who liked it
  • Management of proxy servers, mobile devices and challenge resolver
  • Login by username and password, sessionid and support 2FA
  • Managing messages and threads for Direct and attach files
  • Download and upload a Photo, Video, IGTV, Reels, Albums and Stories
  • Work with Users, Posts, Comments, Insights, Collections, Location and Hashtag
  • Insights by account, posts and stories
  • Like, following, commenting, editing account (Bio) and much more else

instagrapi - Unofficial Instagram API for Python

Fast and effective Instagram Private API wrapper (public+private requests and challenge resolver) without selenium. Use the most recent version of the API from Instagram, which was obtained using reverse-engineering with Charles Proxy and Proxyman.

Instagram API valid for 28 June 2023 (last reverse-engineering check)

Support Python >= 3.9

For any other languages (e.g. C++, C#, F#, D, Golang, Erlang, Elixir, Nim, Haskell, Lisp, Closure, Julia, R, Java, Kotlin, Scala, OCaml, JavaScript, Crystal, Ruby, Rust, Swift, Objective-C, Visual Basic, .NET, Pascal, Perl, Lua, PHP and others), I suggest using instagrapi-rest or Lamadava SaaS

Support Chat in Telegram and GitHub Discussions

Features

  1. Performs Web API or Mobile API requests depending on the situation (to avoid Instagram limits)
  2. Login by username and password, including 2FA and by sessionid (and uses Authorization header instead Cookies)
  3. Challenge Resolver have Email and SMS handlers
  4. Support upload a Photo, Video, IGTV, Reels, Albums and Stories
  5. Support work with User, Media, Comment, Insights, Collections, Location (Place), Hashtag and Direct Message objects
  6. Like, Follow, Edit account (Bio) and much more else
  7. Insights by account, posts and stories
  8. Build stories with custom background, font animation, link sticker and mention users
  9. In the next release, account registration and captcha passing will appear

Examples of apps that use instagrapi

Basic Usage

from instagrapi import Client

cl = Client()
cl.login(ACCOUNT_USERNAME, ACCOUNT_PASSWORD)

user_id = cl.user_id_from_username("adw0rd")
medias = cl.user_medias(user_id, 20)
Additional example
from instagrapi import Client
from instagrapi.types import StoryMention, StoryMedia, StoryLink, StoryHashtag

cl = Client()
cl.login(USERNAME, PASSWORD, verification_code="<2FA CODE HERE>")

media_pk = cl.media_pk_from_url('https://www.instagram.com/p/CGgDsi7JQdS/')
media_path = cl.video_download(media_pk)
adw0rd = cl.user_info_by_username('adw0rd')
hashtag = cl.hashtag_info('dhbastards')

cl.video_upload_to_story(
    media_path,
    "Credits @adw0rd",
    mentions=[StoryMention(user=adw0rd, x=0.49892962, y=0.703125, width=0.8333333333333334, height=0.125)],
    links=[StoryLink(webUri='https://github.com/adw0rd/instagrapi')],
    hashtags=[StoryHashtag(hashtag=hashtag, x=0.23, y=0.32, width=0.5, height=0.22)],
    medias=[StoryMedia(media_pk=media_pk, x=0.5, y=0.5, width=0.6, height=0.8)]
)

Documentation

Contributing

List of contributors

To release, you need to call the following commands:

python setup.py sdist
twine upload dist/*

More Repositories

1

instagrapi-rest

RESTful API Wrapper for Instagram Private API
Python
294
star
2

django-nginx-image

Resizing and cropping images via Nginx, as well as caching the result
Python
63
star
3

django-sql-stacktrace

Puts a python stacktrace in the SQL query as a comment (for debugging)
Python
31
star
4

marcus

Bilingual blog on Django
Python
28
star
5

django-multi-sessions

Multiple backends for your sessions!
Python
22
star
6

django-torrent-stream

Wraps the Torrent Stream http://torrentstream.org/
Python
17
star
7

zstdcat

Zstandard console reader
Python
9
star
8

django-social-auth-widget

Simple widget for django-social-auth
Python
9
star
9

django-sphinxsearch

A transparent layer for full-text search using Sphinx API and Django
Python
8
star
10

django-goto-url

Wraps external links in base64 and relocate on the special View, later redirect to source URL
Python
7
star
11

jquery-cleverfocus

Set the focus to the desired form element when text is entered without a focus
JavaScript
6
star
12

pre-code-review

Code Review (pep8, pyflakes) and Check Commit Message (check format of message) Git Hooks
Python
5
star
13

nagios-sentry

Plugin for Nagios, which check a count of messages in Sentry
Python
4
star
14

django-comments-plus

Extended django.contrib.comments, reviews, user registration via comment form, ajax submit and validation, subscription/unsubscribing (+web-interface)
Python
4
star
15

lettuce-py3

Python
3
star
16

smartencoding

Python smart encoding (smart_unicode and other functions)
Python
3
star
17

instagrapi-bot

Any useful improvements around instagrapi
Python
3
star
18

CryptoCurrency

Frontend for https://smappi.org/marketplace/adw0rd/cryptocurrency/
HTML
3
star
19

django-timeintervaller

A simple asynchronous task-scheduler for Django
Python
2
star
20

yandex-fotki

The plugin to display photos from photohosting "Yandeks.Fotki" to your blog on Wordpress
PHP
2
star
21

github-sync

Github Syncer. Checks and pulls all your GitHub repos
Python
2
star
22

salad-py3

Python
2
star
23

chatea

Simple Chat with Smappi Chatea API (https://smappi.org/api/adw0rd/chatea/)
HTML
1
star
24

solidity-create2-web3-example

An example for address prediction via create2
JavaScript
1
star