Skip to main content

instapost

logo

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:

  1. Create a Meta App → developers.facebook.com/apps/create
  2. Click Add Product and set up Instagram
  3. In App Roles > Roles, assign Instagram Tester to your account
  4. Go to Instagram > API Setup with Instagram login, add your account, click Generate token
  5. 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

Metadata

Release files for instapost 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for instapost 0.2.1
File Size Uploaded
instapost-0.2.1.tar.gz 107.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for instapost 0.2.1
File Interpreter ABI Platform
instapost-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 118.3 kB

Release files / instapost-0.2.1.tar.gz

Download URL instapost-0.2.1.tar.gz
Size 107.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6e502de0fd179ad7800cfbceb039eaf17d42b2afb7a97bd5fe32c387cc2d86d6
BLAKE2b-256 checksum
How to use checksums
c45bb32527706b89a6913f7b6816bafb2a12ca7b59002d729dac1575181592da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 3, 2026.

Transparency log

Release files / instapost-0.2.1-py3-none-any.whl

Download URL instapost-0.2.1-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4bb59b17e1adb853a1bcf16fda0d2789616b0cce7e2523f6a521ee7b415a982f
BLAKE2b-256 checksum
How to use checksums
1a9d7f720efc3bd11bfbf42e4edab26fe6161294724bd948fe21222b9b3f55cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page