Skip to main content

onepostly

Official Python SDK for the Onepostly API — one client for X, Instagram, LinkedIn, TikTok, YouTube, Facebook, Threads, Pinterest, and Bluesky.

Python 3.9+. The only runtime dependency is httpx.

Installation

pip install onepostly

Usage

import os
from onepostly import Onepostly

client = Onepostly(api_key=os.environ["ONEPOSTLY_API_KEY"])

result = client.create_post(
    "Hello from Onepostly",
    destinations=[{"connectionId": "…"}],
)
print(result["post"]["id"])

The constructor also reads ONEPOSTLY_API_KEY from the environment when api_key is omitted. Resource methods use the REST field names (camelCase); the create_post convenience wrapper accepts snake_case kwargs.

Scheduling

client.create_post(
    "Tomorrow morning",
    scheduled_for="2026-09-01T09:00:00",  # timezone-naive local time
    timezone="Europe/Istanbul",
    destinations=[{"connectionId": "…"}],
)

Media

with open("photo.jpg", "rb") as f:
    media = client.media.upload(f, filename="photo.jpg")["media"]

client.create_post(
    "With an image",
    media_kind="image",
    media_urls=[media["url"]],
    destinations=[{"connectionId": "…"}],
)

Insights

insights = client.insights.get(post_id)["insights"]
timeline = client.insights.timeline(post_id, from_="2026-08-01", to="2026-08-28")

Error handling

Every non-2xx response raises OnepostlyError carrying the API's machine-readable code and HTTP status:

from onepostly import OnepostlyError, is_insufficient_wallet

try:
    client.create_post("Hello", destinations=[{"connectionId": "…"}])
except OnepostlyError as error:
    if is_insufficient_wallet(error):
        ...  # HTTP 402 — top up the workspace wallet
    print(error.code, error.status, error.message)

API reference

Resource Methods
client.posts create list get cancel remote_delete
client.media upload list delete
client.connections list start_oauth
client.insights get timeline
client.comments list create delete
client.engagement list_retweeters retweet undo_retweet like unlike bookmark remove_bookmark quote
client.webhooks event_types list create update delete rotate_secret deliveries test

Full request/response reference: onepostly.com/openapi.json

Runnable scripts live in examples/. See CONTRIBUTING.md for development and release flow.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onepostly-0.1.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

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

onepostly-0.1.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onepostly-0.1.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for onepostly-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed721b4125b250be3dc9830716a2b06d483e4f645a2152bcbd2a0cde1752b78f
MD5 f6effaefb47c80a7f0c4834132ac1edf
BLAKE2b-256 244a653a77e1159730f47b91babb055c0e874fc82a0197dca67b7307950c7eef

See more details on using hashes here.

Provenance

The following attestation bundles were made for onepostly-0.1.0.tar.gz:

Publisher: publish.yml on onepostly/onepostly-python

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

File details

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

File metadata

  • Download URL: onepostly-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for onepostly-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a5488aad6c0a58a10c5f6ea329e86d5693b1634110a157cc9da1499b4c3082f
MD5 866b432d3548a6fbe6e5f641bbd16422
BLAKE2b-256 68fc2d866697c5e0c7b63516a8e9f3747e62ddc8f99f21408aa281a6c276be18

See more details on using hashes here.

Provenance

The following attestation bundles were made for onepostly-0.1.0-py3-none-any.whl:

Publisher: publish.yml on onepostly/onepostly-python

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

Release history Release notifications | RSS feed

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

This release

0.1.0 This release

2 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