Official Python SDK for the SociaHive API — social media management, automation flows, and analytics.
Project description
sociahive
Official Python SDK for the SociaHive API.
pip install sociahive
Quickstart
from sociahive import SociaHive
sh = SociaHive(api_key="sk_...")
accounts = sh.accounts.list()
print(f"Connected: {[a['platform'] for a in accounts['data']]}")
post = sh.posts.create(
text="Hello from Python!",
platforms=[{"platform": "instagram", "account_id": accounts["data"][0]["id"]}],
schedule_type="scheduled",
scheduled_at="2026-06-01T09:00:00Z",
timezone="UTC",
)
print(f"Scheduled post {post['id']}")
Auth
Pass exactly one of api_key (long-lived) or oauth_token (per-user OAuth):
sh = SociaHive(api_key="sk_...")
sh = SociaHive(oauth_token="sh_at_...")
Generate keys at https://www.sociahive.com/settings?tab=api-keys.
Context manager
The client holds an httpx.Client connection pool. Use with for tight scopes:
with SociaHive(api_key="sk_...") as sh:
for flow in sh.flows.list()["data"]:
if flow["status"] == "draft":
sh.flows.activate(flow["id"])
Outside a with block, call sh.close() when you're done.
Error handling
from sociahive import SociaHive, SociaHiveError
try:
sh.posts.create(text="...", platforms=[...])
except SociaHiveError as err:
if err.is_auth_error:
print("Bad API key or insufficient scope")
elif err.is_rate_limited:
print("Slow down — 1000 req/hr default")
else:
print(f"HTTP {err.status}: {err}")
What's covered
| Domain | Methods |
|---|---|
sh.accounts |
list |
sh.posts |
list, get, create, update, schedule, publish, cancel, bulk |
sh.flows |
list, get, create, update, delete, activate, deactivate, add_node, update_node, add_edge, stats, collected_data, generate |
sh.analytics |
get, export |
For other endpoints, fall back to httpx directly with X-API-Key. Full spec:
https://www.sociahive.com/api/v1/openapi.json.
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 sociahive-0.1.0.tar.gz.
File metadata
- Download URL: sociahive-0.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dff5502e9cce642e41f581d11d600e08d3220b02553784d07d7666677404d5b7
|
|
| MD5 |
884e3a573fee4a5c5d39fce1212f8dd5
|
|
| BLAKE2b-256 |
f9aa3fb7b04504a57921fc45a6a780e0178f4e2589bae29224905fefe99b0d00
|
File details
Details for the file sociahive-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sociahive-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ad84b6b0e30730d0fadab6116a458bc2fb7454b524c8878dca95fbaaa789a1b
|
|
| MD5 |
08b19cebbcfc67340691449161de768d
|
|
| BLAKE2b-256 |
e2d3e3dda507c61ea2588bb628431ebae5b436803d235d12a85f31b32045a888
|