A Python library for automating Instagram posting (images, reels, carousels)
Project description
instapost
A simple and powerful Python library for posting to Instagram using the Instagram Graph API.
Post images, reels, and carousels with just a few lines of code. Auto-upload local files or use remote URLs.
How it works:
from instapost import InstagramPoster
poster = InstagramPoster(access_token="YOUR_TOKEN",
ig_user_id="YOUR_IG_ID"
)
poster.post_image(image="./photo.jpg",
caption="Check this out! 📸")
That's it. Your photo is on Instagram.
Setup (5 minutes)
What you need:
- Instagram Business account (connected to Facebook)
- Meta for Developers account (free)
Steps:
- Create a Meta App → developers.facebook.com/apps/create
- Click Add Product and set up Instagram
- In App Roles > Roles, assign Instagram Tester to your account
- Go to Instagram > API Setup with Instagram login, add your account, click Generate token
- Copy the token—you're done!
✨ That's it. No app review needed for personal use. Your token works immediately in Development Mode.
Usage
from instapost import InstagramPoster
poster = InstagramPoster(
access_token="YOUR_TOKEN",
ig_user_id="YOUR_IG_ID"
)
# Post an image
poster.post_image(image="./photo.jpg", caption="Check this out! 📸")
# Post a reel
poster.post_reel(video="./video.mp4", caption="New reel! 🎬", share_to_feed=True)
# Post a carousel
poster.post_carousel(
media_items=[
{"media": "./photo1.jpg", "type": "IMAGE"},
{"media": "./video.mp4", "type": "VIDEO"},
],
caption="Swipe through! 👉"
)
# Verify you're connected
print(poster.verify()['username'])
Local files? Just pass the file path—instapost auto-uploads to Catbox. Remote URLs work too. Mix them in one post.
Requirements
- Instagram Business account connected to Facebook
- Meta for Developers account (free)
- Python 3.7+
Installation
pip install instapost
Media Specs
| Type | Format | Size | Duration |
|---|---|---|---|
| Images | JPEG, PNG, WebP, GIF | ≤ 8MB | — |
| Reels | MP4 | ≤ 1GB | 3-90s |
| Carousel | 2-10 items | per item | — |
How it works
- Local files → Auto-upload to Catbox → Send to Instagram API
- Remote URLs → Send directly to Instagram API
Learn more
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file instapost-0.2.1.tar.gz.
File metadata
- Download URL: instapost-0.2.1.tar.gz
- Upload date:
- Size: 107.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e502de0fd179ad7800cfbceb039eaf17d42b2afb7a97bd5fe32c387cc2d86d6
|
|
| MD5 |
be2ad02b0f35470f4627993cc0dbe7f0
|
|
| BLAKE2b-256 |
c45bb32527706b89a6913f7b6816bafb2a12ca7b59002d729dac1575181592da
|
Provenance
The following attestation bundles were made for instapost-0.2.1.tar.gz:
Publisher:
publish-to-pypi.yml on pedroblayaluz/instapost
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
instapost-0.2.1.tar.gz -
Subject digest:
6e502de0fd179ad7800cfbceb039eaf17d42b2afb7a97bd5fe32c387cc2d86d6 - Sigstore transparency entry: 908193319
- Sigstore integration time:
-
Permalink:
pedroblayaluz/instapost@50f7652ce50f36a5250e53270cd1597d05fca7a1 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/pedroblayaluz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@50f7652ce50f36a5250e53270cd1597d05fca7a1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file instapost-0.2.1-py3-none-any.whl.
File metadata
- Download URL: instapost-0.2.1-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bb59b17e1adb853a1bcf16fda0d2789616b0cce7e2523f6a521ee7b415a982f
|
|
| MD5 |
b6dd283e3c6b10387383ece761dd8a8b
|
|
| BLAKE2b-256 |
1a9d7f720efc3bd11bfbf42e4edab26fe6161294724bd948fe21222b9b3f55cb
|
Provenance
The following attestation bundles were made for instapost-0.2.1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on pedroblayaluz/instapost
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
instapost-0.2.1-py3-none-any.whl -
Subject digest:
4bb59b17e1adb853a1bcf16fda0d2789616b0cce7e2523f6a521ee7b415a982f - Sigstore transparency entry: 908193320
- Sigstore integration time:
-
Permalink:
pedroblayaluz/instapost@50f7652ce50f36a5250e53270cd1597d05fca7a1 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/pedroblayaluz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@50f7652ce50f36a5250e53270cd1597d05fca7a1 -
Trigger Event:
release
-
Statement type: