Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/stanvanrooy/instauto

Simple to use wrapper around the private Instagram API, written in Python.
https://github.com/stanvanrooy/instauto

bot hacktoberfest instagram instagram-api instagram-scraper python

Last synced: 4 months ago
JSON representation

Simple to use wrapper around the private Instagram API, written in Python.

Lists

README

        

# Instauto
[![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg?style=flat-square)](#contributors-)
[![GitHub stars](https://img.shields.io/github/stars/stanvanrooy/instauto)](https://github.com/stanvanrooy/instauto/stargazers)
[![PyPI license](https://img.shields.io/pypi/l/instauto)](https://pypi.python.org/project/instauto/)
[![Downloads](https://pepy.tech/badge/instauto/week)](https://pepy.tech/project/instauto)
![coverage](https://github.com/stanvanrooy/instauto/blob/master/coverage.svg)
[![Documentation Status](https://readthedocs.org/projects/instauto/badge/?version=latest)](https://instauto.readthedocs.io/en/latest/?badge=latest)

`instauto` is a Python package for automating Instagram, making use of the private Instagram API. `instauto` tries to have feature parity with the Instagram app.

## Overview
Instauto has 3 main api's that can be used: `instauto.api`, `instauto.bot` and `instauto.helpers`. You should probably use `instauto.helpers` and only start using `instauto.api` when you actually need its functionality.

Everything in `instauto`, is based around the 'core' `instauto.api` package. This package interacts directly with the private Instagram API and contains all functionality. This package is both the most flexible (you can update all requests sent and receive the full response back, for example), but also the most complex. You likely do not need to use this package.

The `instauto.helpers` package, is an abstraction above the `instauto.api` pacakge. It offers a little bit less flexibility, but is a lot less complex to use. It also offers [typed models](https://github.com/stanvanrooy/instauto/blob/master/instauto/helpers/models.py).

The `instauto.bot` package, is another abstraction, but this time over the `instauto.helpers` package. This package has pretty much no flexibility, but can be set up in 10 lines of Python code.

## Installation
The package can be installed with the following pip command:
```pip install instauto```

## Getting started
Below are a few examples for getting stared quickly. After getting started, you'll probably want to take a quick look at the more [detailed documentation](https://instauto.readthedocs.io/) on readthedocs.

### Authentication
You'll want to do this as little as possible. Instagram sees logging in often as a huge red flag.
```python
from instauto.api.client import ApiClient
client = ApiClient(username='your_username', password='your_password')
client.log_in()
```

### Restoring state
Because of that, you can restore your session.
```python
client.save_to_disk('your-savefile.instauto')
client = ApiClient.initiate_from_file('your-savefile.instauto')
```

### Making new friends
Ofcourse `instauto` also supports (un)following users.
```python
from instauto.helpers.friendships import follow_user, unfollow_user
follow_user(client, username='stan000_')
unfollow_user(client, username='stan000_')
```

### Finding new friends
But before you can follow users, you'll need to find them first.
```python
from instauto.helpers.search import search_username
users = search_username(client, "username", 10)
```

### Retrieving 100 of your followers
Getting a list of users that follow you is also super simple.
```python
from instauto.helpers.friendships import get_followers
followers = get_followers(client, username='your_username', limit=100)
```

### Uploading images
`instauto` also offers a simple API for uploading images to your feed and story.
```python
from instauto.helpers.post import upload_image_to_feed
upload_image_to_feed(client, './cat.jpg', 'Hello from instauto!')
```

### Looking at your feed
Your feed can't be missing, it's pretty much what Instagram is about, isn't it?
```python
from instato.helpers.feed import get_feed
posts = get_feed(client, 100)
```

## More examples
Looking for something else? We have more examples:
- [feed helper functions](https://github.com/stanvanrooy/instauto/tree/master/examples/helpers/feed)
- [friendship helper functions](https://github.com/stanvanrooy/instauto/tree/master/examples/helpers/friendships)
- [post helper functions](https://github.com/stanvanrooy/instauto/tree/master/examples/helpers/post)
- [search helper function](https://github.com/stanvanrooy/instauto/tree/master/examples/helpers/search)
- [advanced examples](https://github.com/stanvanrooy/instauto/tree/master/examples/api)

Stil no look? Submit a feature request!

## Support
This is a hobby project, which means sometimes other things take priority. I will review issues and work on issues when I have the time. Spamming new issues, asking for a ton of updates, or things like that, will not speed up the process. It will probably even give me less motivation to work on it :)

If you're looking for paid support, please reach out to me at [[email protected]](mailto:[email protected]).

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

There's an [article up on the wiki](https://github.com/stanvanrooy/instauto/wiki/Setting-up-a-development-environment), that explains how to set up a development environment.

## License
[MIT](https://choosealicense.com/licenses/mit/)

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):



MaroΕ‘ Gonda

⚠️ πŸ’»

Norbert GocnΓ­k

πŸ’»

Jakub Juhas

πŸ’» πŸ“– ⚠️

Samu1808

πŸ’»

Kevin Jonathan

πŸ“–

Martin Nikolov

πŸ’»

b177y

πŸ’» ⚠️ πŸ“–



wowopo

πŸ’»

Stan van Rooy

πŸ“– πŸ’» ⚠️

Tizian Seehaus

πŸ’»

Florkast

πŸ“–

Artur

πŸ’» πŸ“–

Felix Fischer

πŸ’»

alperenkaplan

πŸ’» πŸ“–



Javadz

πŸ’» πŸ“–

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!