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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed721b4125b250be3dc9830716a2b06d483e4f645a2152bcbd2a0cde1752b78f
|
|
| MD5 |
f6effaefb47c80a7f0c4834132ac1edf
|
|
| BLAKE2b-256 |
244a653a77e1159730f47b91babb055c0e874fc82a0197dca67b7307950c7eef
|
Provenance
The following attestation bundles were made for onepostly-0.1.0.tar.gz:
Publisher:
publish.yml on onepostly/onepostly-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
onepostly-0.1.0.tar.gz -
Subject digest:
ed721b4125b250be3dc9830716a2b06d483e4f645a2152bcbd2a0cde1752b78f - Sigstore transparency entry: 2643632857
- Sigstore integration time:
-
Permalink:
onepostly/onepostly-python@d3c425fca8c839f8d8192335d77b4c16ffc042e1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/onepostly
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d3c425fca8c839f8d8192335d77b4c16ffc042e1 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a5488aad6c0a58a10c5f6ea329e86d5693b1634110a157cc9da1499b4c3082f
|
|
| MD5 |
866b432d3548a6fbe6e5f641bbd16422
|
|
| BLAKE2b-256 |
68fc2d866697c5e0c7b63516a8e9f3747e62ddc8f99f21408aa281a6c276be18
|
Provenance
The following attestation bundles were made for onepostly-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on onepostly/onepostly-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
onepostly-0.1.0-py3-none-any.whl -
Subject digest:
4a5488aad6c0a58a10c5f6ea329e86d5693b1634110a157cc9da1499b4c3082f - Sigstore transparency entry: 2643633331
- Sigstore integration time:
-
Permalink:
onepostly/onepostly-python@d3c425fca8c839f8d8192335d77b4c16ffc042e1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/onepostly
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d3c425fca8c839f8d8192335d77b4c16ffc042e1 -
Trigger Event:
push
-
Statement type: