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_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

instapost-0.2.0.tar.gz (106.5 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.2.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: instapost-0.2.0.tar.gz
  • Upload date:
  • Size: 106.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for instapost-0.2.0.tar.gz
Algorithm Hash digest
SHA256 996573bad2a1f6a61fed561ec78a46dec3668fc284972ff534ee3006179c4dd7
MD5 c918fca07d1f0efff06455adf098828f
BLAKE2b-256 498387dc4febef30c888cc7d71bac090dde1025bb9ad36d2d833d783340b0d83

See more details on using hashes here.

Provenance

The following attestation bundles were made for instapost-0.2.0.tar.gz:

Publisher: publish-to-pypi.yml on pedroblayaluz/instapost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: instapost-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for instapost-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23f854a7a8c36548e76181850b921f1a1b99d82b6bb985a10b9a1d092cc6d764
MD5 6222e2c43c553cd15e9c823da2904074
BLAKE2b-256 df7ed6975bb78e1590c90807ad3d40bf2c5094477eb8edced6c6dd01e848909d

See more details on using hashes here.

Provenance

The following attestation bundles were made for instapost-0.2.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on pedroblayaluz/instapost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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