Skip to main content

A Python library for automating Instagram posting (images, reels, carousels)

Project description

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_urls=[
        {"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

instapost-0.1.0.tar.gz (105.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

instapost-0.1.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file instapost-0.1.0.tar.gz.

File metadata

  • Download URL: instapost-0.1.0.tar.gz
  • Upload date:
  • Size: 105.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for instapost-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7241cd67c05ab985eff6333c24f96a0f3c1b3b76250ec515c36d65096db257bd
MD5 79581beb97a974df1d414b4ce2b14d74
BLAKE2b-256 7fd5b0e89bbd2d2c7e0f35bb32238cef5c8691d629134588ee6f1fb02d1e5ad1

See more details on using hashes here.

File details

Details for the file instapost-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: instapost-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for instapost-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a790da426b54bc530fc0f7ffe416b31661acc0881c4ed974cb2860395710cb6d
MD5 dd88e6338239ca0878ead20166eec7ba
BLAKE2b-256 d670502d0d85919c13c963fb218be929666a6a828bc7c7049b8146bf644e01f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page