All Projects → ping → Instagram_private_api

ping / Instagram_private_api

Licence: mit
A Python library to access Instagram's private API.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Instagram private api

Instagram Bot Dm
Instagram bot to send direct messages
Stars: ✭ 101 (-95.56%)
Mutual labels:  instagram-api, instagram
Instagrapi
Fast and effective Instagram Private API wrapper
Stars: ✭ 157 (-93.09%)
Mutual labels:  instagram-api, instagram
Toolsig
toolsigv3.1 (Instagram Tools)
Stars: ✭ 121 (-94.68%)
Mutual labels:  instagram-api, instagram
Instagram private api extensions
An extension module to https://github.com/ping/instagram_private_api
Stars: ✭ 97 (-95.73%)
Mutual labels:  instagram-api, instagram
Instabot.rb
An instagram bot works without instagram api, only needs your username and password. written in ruby
Stars: ✭ 149 (-93.44%)
Mutual labels:  instagram-api, instagram
Swiftagram
A modern Swift wrapper for Instagram Private API.
Stars: ✭ 100 (-95.6%)
Mutual labels:  instagram-api, instagram
Instagram ssl pinning
Bypassing SSL Pinning in Instagram Android App
Stars: ✭ 135 (-94.06%)
Mutual labels:  instagram-api, instagram
Instagram Api Toolkit
Instagram Private API generator toolkit - A single source of truth for generated SDKs
Stars: ✭ 48 (-97.89%)
Mutual labels:  instagram-api, instagram
Instagram Bot
An Instagram bot developed using the Selenium Framework
Stars: ✭ 138 (-93.93%)
Mutual labels:  instagram-api, instagram
React Native Instagram Login
a react native instagram login component (support android & ios). Pull requests are welcome!
Stars: ✭ 139 (-93.88%)
Mutual labels:  instagram-api, instagram
Igql
Unofficial Instagram GraphQL API to collet data without authentication
Stars: ✭ 80 (-96.48%)
Mutual labels:  instagram-api, instagram
Instagram Followers Bot
A bot for Instagram. You can follow users using a tag or in a specific location, unfollow those who dont follow-you-back, and follow-back those who follow you
Stars: ✭ 149 (-93.44%)
Mutual labels:  instagram-api, instagram
Instauto
Simple to use wrapper around the private Instagram API, written in Python.
Stars: ✭ 52 (-97.71%)
Mutual labels:  instagram-api, instagram
Instagram api gem
A Ruby wrapper for the Instagram API
Stars: ✭ 100 (-95.6%)
Mutual labels:  instagram-api, instagram
Personal Influxdb
Import data from various APIs into InfluxDB
Stars: ✭ 51 (-97.76%)
Mutual labels:  instagram-api, instagram
Inwidget
inWidget - free Instagram widget for your website. Allows you to show photos from an Instagram account, by hashtags and more.
Stars: ✭ 132 (-94.19%)
Mutual labels:  instagram-api, instagram
Goinsta
Unofficial Instagram API written in Golang
Stars: ✭ 733 (-67.75%)
Mutual labels:  instagram-api, instagram
Gatsby Source Instagram All
⚛️📸 Gatsby source plugin for fetching all your instagram posts
Stars: ✭ 42 (-98.15%)
Mutual labels:  instagram-api, instagram
Onegram
This repository is no longer maintained.
Stars: ✭ 137 (-93.97%)
Mutual labels:  instagram-api, instagram
Mygf Instagram
Like posts of my girlfriend's Instagram using web api, don't need any api key and access tokens just login and password
Stars: ✭ 140 (-93.84%)
Mutual labels:  instagram-api, instagram

Instagram Private API

A Python wrapper for the Instagram private API with no 3rd party dependencies. Supports both the app and web APIs.

Python 2.7, 3.5 Release Docs Build

Build

Overview

I wrote this to access Instagram's API when they clamped down on developer access. Because this is meant to achieve parity with the official public API, methods not available in the public API will generally have lower priority.

Problems? Please check the docs before submitting an issue.

Features

An extension module is available to help with common tasks like pagination, posting photos or videos.

Documentation

Documentation is available at https://instagram-private-api.readthedocs.io/en/latest/

Install

Install with pip:

pip install git+https://[email protected]/ping/[email protected]

To update:

pip install git+https://[email protected]/ping/[email protected] --upgrade

To update with latest repo code:

pip install git+https://[email protected]/ping/instagram_private_api.git --upgrade --force-reinstall

Tested on Python 2.7 and 3.5.

Usage

The app API client emulates the official app and has a larger set of functions. The web API client has a smaller set but can be used without logging in.

Your choice will depend on your use case.

The examples/ and tests/ are a good source of detailed sample code on how to use the clients, including a simple way to save the auth cookie for reuse.

Option 1: Use the official app's API

from instagram_private_api import Client, ClientCompatPatch

user_name = 'YOUR_LOGIN_USER_NAME'
password = 'YOUR_PASSWORD'

api = Client(user_name, password)
results = api.feed_timeline()
items = [item for item in results.get('feed_items', [])
         if item.get('media_or_ad')]
for item in items:
    # Manually patch the entity to match the public api as closely as possible, optional
    # To automatically patch entities, initialise the Client with auto_patch=True
    ClientCompatPatch.media(item['media_or_ad'])
    print(item['media_or_ad']['code'])

Option 2: Use the official website's API

from instagram_web_api import Client, ClientCompatPatch, ClientError, ClientLoginError

# Without any authentication
web_api = Client(auto_patch=True, drop_incompat_keys=False)
user_feed_info = web_api.user_feed('329452045', count=10)
for post in user_feed_info:
    print('%s from %s' % (post['link'], post['user']['username']))

# Some endpoints, e.g. user_following are available only after authentication
authed_web_api = Client(
    auto_patch=True, authenticate=True,
    username='YOUR_USERNAME', password='YOUR_PASSWORD')

following = authed_web_api.user_following('123456')
for user in following:
    print(user['username'])

# Note: You can and should cache the cookie even for non-authenticated sessions.
# This saves the overhead of a single http request when the Client is initialised.

Avoiding Re-login

You are advised to persist/cache the auth cookie details to avoid logging in every time you make an api call. Excessive logins is a surefire way to get your account flagged for removal. It's also advisable to cache the client details such as user agent, etc together with the auth details.

The saved auth cookie can be reused for up to 90 days.

Donate

Want to keep this project going? Please donate generously https://www.buymeacoffee.com/ping

Build

Support

Make sure to review the contributing documentation before submitting an issue report or pull request.

Legal

Disclaimer: This is not affliated, endorsed or certified by Instagram. This is an independent and unofficial API. Strictly not for spam. Use at your own risk.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].