Giter Site home page Giter Site logo

alanmartines / instagrapi-rest Goto Github PK

View Code? Open in Web Editor NEW

This project forked from subzeroid/instagrapi-rest

0.0 0.0 0.0 108 KB

RESTful API Wrapper for Instagram Private API

Home Page: https://lamadava.com

License: MIT License

Python 84.31% Go 12.82% Swift 2.15% Dockerfile 0.61% Procfile 0.10%

instagrapi-rest's Introduction

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

Features:

  • Anonymous getting of user, posts, stories, highlights, followers and following users
  • Anonymous getting an email and phone number, if the user specified them in his business profile
  • Anonymous getting of post, story, album, Reels, IGTV data and the ability to download content
  • Anonymous getting of hashtag and location data, as well as a list of posts for them
  • Anonymous getting of all comments on a post and a list of users who liked it
  • Management of proxy servers, mobile devices, solving captcha 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

Tests

RESTful API Service for instagrapi

Allows you to use the Instagram Private API on any operating system from any programming language (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) to automate the work of your accounts.

Deploy Donate

Support Chat in Telegram

Features

  1. Authorization: Login, support 2FA and manage settings
  2. Media: info, delete, edit, like, archive and much more else
  3. Video: download, upload to feed and story
  4. Photo: download, upload to feed and story
  5. IGTV: download, upload to feed and story
  6. Clip (Reels): download, upload to feed and story
  7. Album: download, upload to feed and story
  8. Story: info, delete, seen, download and much more else
  9. User: followers/following, info, follow/unfollow, remove_follower and much more else
  10. Insights: media, account

Installation

Install ImageMagick library:

sudo apt install imagemagick

...and comment the line with strict security policies of ImageMagick in /etc/ImageMagick-6/policy.xml:

<!--<policy domain="path" rights="none" pattern="@*"/>-->

Run docker container:

docker run adw0rd/instagrapi-rest

Or clone the repository:

git clone https://github.com/adw0rd/instagrapi-rest.git
cd instagrapi-rest

Build your image and run the container:

docker build -t instagrapi-rest .
docker run -p 8000:8000 instagrapi-rest

Or you can use docker-compose:

docker-compose up -d

Or manual installation and launch:

python3 -m venv .venv
. .venv/bin/activate
pip install -U wheel pip -Ur requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000 --reload

Usage

Open in browser http://localhost:8000/docs and follow the instructions

swagger

Get sessionid:

curl -X 'GET' \
  'http://localhost:8000/auth/login' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'username=<USERNAME>&password=<PASSWORD>&verification_code=<2FA CODE>'

Upload photo:

curl -X 'POST' \
  'http://localhost:8000/photo/upload_to_story' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'sessionid=<SESSIONID>' \
  -F '[email protected];type=image/jpeg'

Upload photo by URL:

curl -X 'POST' \
  'https://localhost:8000/photo/upload_to_story/by_url' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'sessionid=<SESSIONID>&url=https%3A%2F%2Fapi.telegram.org%2Ffile%2Ftest.jpg'

Upload video:

curl -X 'POST' \
  'http://localhost:8000/video/upload_to_story' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'sessionid=<SESSIONID>' \
  -F '[email protected];type=video/mp4'

Upload video by URL:

curl -X 'POST' \
  'https://localhost:8000/video/upload_to_story/by_url' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'sessionid=<SESSIONID>&url=https%3A%2F%2Fapi.telegram.org%2Ffile%2Ftest.MP4'

Generating client code

You can use this repo to generate client code for this rest api in any language you want to use.

Exapmle: openapi-generator-cli generate -g python -i https://localhost:8000]/openapi.json --skip-validate-spec Note skip-validate-spec is not necesserily required, when running it on my pc it couldn't validate the spec for some reason.

Testing

Tests can be run like this:

docker-compose run api pytest tests.py

One test:

docker-compose run api pytest tests.py::test_media_pk_from_code

or without docker-compose:

docker run --rm -v "$(pwd):/app" instagrapi-rest pytest tests.py

Development

For debugging:

docker-compose run --service-ports api

instagrapi-rest's People

Contributors

adw0rd avatar bedefaced avatar soneji avatar franciscodadone avatar stiveknx avatar erezamihud avatar jmallone avatar gholamrezaeipt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.