Skip to main content

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

Metadata

Release files for sociahive 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sociahive 0.1.0
File Size Uploaded
sociahive-0.1.0.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sociahive 0.1.0
File Interpreter ABI Platform
sociahive-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.5 kB

Release files / sociahive-0.1.0.tar.gz

Download URL sociahive-0.1.0.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
dff5502e9cce642e41f581d11d600e08d3220b02553784d07d7666677404d5b7
BLAKE2b-256 checksum
How to use checksums
f9aa3fb7b04504a57921fc45a6a780e0178f4e2589bae29224905fefe99b0d00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / sociahive-0.1.0-py3-none-any.whl

Download URL sociahive-0.1.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ad84b6b0e30730d0fadab6116a458bc2fb7454b524c8878dca95fbaaa789a1b
BLAKE2b-256 checksum
How to use checksums
e2d3e3dda507c61ea2588bb628431ebae5b436803d235d12a85f31b32045a888
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release 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