Official UniPost API client for Python
Project description
unipost
Official UniPost API client for Python. Post to 7 social platforms with one API call.
Installation
pip install unipost
For async support:
pip install unipost[async]
Quick Start
from unipost import UniPost
# Reads UNIPOST_API_KEY from environment automatically
client = UniPost()
post = client.posts.create(
caption="Hello from UniPost! 🚀",
account_ids=["sa_twitter_xxx", "sa_linkedin_xxx"],
)
Usage
List Accounts
result = client.accounts.list()
accounts = result["data"]
# Filter by platform
twitter = client.accounts.list(platform="twitter")
Create Posts
# Immediate publish
post = client.posts.create(
caption="Hello world!",
account_ids=["sa_twitter_xxx"],
)
# Scheduled
post = client.posts.create(
caption="Scheduled post",
account_ids=["sa_twitter_xxx"],
scheduled_at="2026-04-28T09:00:00Z",
)
# Per-platform captions
post = client.posts.create(
platform_posts=[
{"account_id": "sa_twitter_xxx", "caption": "Short tweet 🐦"},
{"account_id": "sa_linkedin_xxx", "caption": "Longer LinkedIn version..."},
]
)
# Save as draft
draft = client.posts.create(
caption="Work in progress",
account_ids=["sa_twitter_xxx"],
status="draft",
)
Async
from unipost import AsyncUniPost
async def main():
client = AsyncUniPost()
post = await client.posts.create(
caption="Async post!",
account_ids=["sa_twitter_xxx"],
)
Webhook Verification
from unipost import verify_webhook_signature
is_valid = verify_webhook_signature(
payload=request.body,
signature=request.headers["X-UniPost-Signature"],
secret=os.environ["UNIPOST_WEBHOOK_SECRET"],
)
Error Handling
from unipost import UniPost, AuthError, RateLimitError, UniPostError
try:
post = client.posts.create(...)
except AuthError:
print("API key invalid")
except RateLimitError as e:
print(f"Rate limited, retry after {e.retry_after}s")
except UniPostError as e:
print(f"API error: {e.status} {e.code} {e}")
Type Hints
Full type annotations included. Works with mypy.
from unipost import Post, SocialAccount
License
MIT
Project details
Release history Release notifications | RSS feed
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 unipost-0.1.1.tar.gz.
File metadata
- Download URL: unipost-0.1.1.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27da481aee6bf02ef39a85570de7bf99849a921655cccba1d218af91496a3956
|
|
| MD5 |
bb7fc2b5bdd9ed11e08871f522d41395
|
|
| BLAKE2b-256 |
3d91ab5190167e78b7383e866d2f388950d9272d7b830b5eaa1fcf8960b6ddca
|
Provenance
The following attestation bundles were made for unipost-0.1.1.tar.gz:
Publisher:
publish.yml on unipost-dev/sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unipost-0.1.1.tar.gz -
Subject digest:
27da481aee6bf02ef39a85570de7bf99849a921655cccba1d218af91496a3956 - Sigstore transparency entry: 1269403838
- Sigstore integration time:
-
Permalink:
unipost-dev/sdk-python@2d746301c9f4fb610567645a813c8af1f0e025db -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/unipost-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2d746301c9f4fb610567645a813c8af1f0e025db -
Trigger Event:
push
-
Statement type:
File details
Details for the file unipost-0.1.1-py3-none-any.whl.
File metadata
- Download URL: unipost-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd11bb44b3f35ea39e387a5f815a8905f92f429ab9ac70b1c151607026a3849d
|
|
| MD5 |
acd24a373d3835010b597f9596ce4600
|
|
| BLAKE2b-256 |
d9c84bfe11b0233f190e7ad91a5bc05f281ee0e661f42681ba5aab277995507d
|
Provenance
The following attestation bundles were made for unipost-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on unipost-dev/sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unipost-0.1.1-py3-none-any.whl -
Subject digest:
fd11bb44b3f35ea39e387a5f815a8905f92f429ab9ac70b1c151607026a3849d - Sigstore transparency entry: 1269403931
- Sigstore integration time:
-
Permalink:
unipost-dev/sdk-python@2d746301c9f4fb610567645a813c8af1f0e025db -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/unipost-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2d746301c9f4fb610567645a813c8af1f0e025db -
Trigger Event:
push
-
Statement type: