Skip to main content

socialsforai

Python client and agent tools for SocialsForAI: one API to publish, schedule and measure posts on X, LinkedIn, Bluesky, Mastodon, Telegram, Discord, Slack, Nostr and more, built for AI agents.

  • No dependencies. Python 3.9+.
  • Safe retries: rate limits, server errors and network errors are retried, and every post gets an idempotency key, so a retry never publishes twice.
  • Every error has a stable code and a fix that says what to do next.
  • Ready-made tools for LangChain, CrewAI and the OpenAI Agents SDK.
pip install socialsforai

Quickstart

from socialsforai import SocialsForAI

socials = SocialsForAI()  # reads SOCIALSFORAI_API_KEY

# No key yet? An agent can sign itself up:
# socials.workspaces.create(name="My agent", email="owner@example.com")

# Connect accounts: send this link to the account owner.
link = socials.connect_links.create(platforms=["x", "linkedin", "bluesky"])
print(link["url"])
socials.connect_links.wait_for(link["id"])

# Check, then publish. One result per account.
check = socials.posts.create(["linkedin", "bluesky"], "We just shipped webhooks.", dry_run=True)
print(check["ok"], check["issues"])
post = socials.posts.create(["linkedin", "bluesky"], "We just shipped webhooks.", wait=True)
for t in post["targets"]:
    print(t["platform"], t["status"], t["url"])

Any API field works as a keyword on posts.create: media, link, thread, auto_thread=True (split long text into a thread), scheduled_at="best", timezone, repeat={"every": "week", "count": 4}, approval="required", platform_options, reply_to and reply_to_comment. The full list is in the agent guide.

Group Methods
Posts posts.create, posts.create_many (up to 50), posts.list, posts.get, posts.update, posts.delete, posts.metrics, posts.replies, posts.wait_for_approval
Accounts accounts.list, accounts.get, accounts.connect, accounts.disconnect, connect_links.create, connect_links.get, connect_links.wait_for
Media media.upload (≤4 MB), media.upload_file (any size)
Events events.list (what happened since an event id; for when you can't receive webhooks)
Workspace workspaces.create, workspace.get, workspace.set_owner_email, usage(), analytics(), platforms(), health(), upgrade_link(plan)
Admin keys.list/create/revoke, webhooks.list/create/delete, verify_webhook(secret, header, raw_body)

Agent tools

The same tools work in each framework: list_accounts, list_platforms, create_connect_link, create_post, create_posts, get_post, list_posts, get_post_metrics, list_replies, list_events, and delete_post. delete_post is off unless you pass include_destructive=True. Errors come back to the model as {"error": {"code", "message", "fix"}} so it can act on the fix.

LangChain / LangGraph (pip install "socialsforai[langchain]")

from langgraph.prebuilt import create_react_agent
from socialsforai.integrations.langchain import socials_tools

agent = create_react_agent(model, socials_tools())

CrewAI (pip install "socialsforai[crewai]")

from crewai import Agent
from socialsforai.integrations.crewai import socials_tools

manager = Agent(role="Social media manager", goal="Publish our launch", backstory="...", tools=socials_tools())

OpenAI Agents SDK (pip install "socialsforai[openai-agents]")

from agents import Agent
from socialsforai.integrations.openai_agents import socials_tools

agent = Agent(name="Social media", instructions="Dry-run before publishing.", tools=socials_tools())

Anything else: socialsforai.tools.TOOLS has each tool's name, description and JSON Schema, and run_tool(client, name, args) runs one.

Limit what an agent can do with socials_tools(tools=["list_accounts", "create_post"]), or give it a scoped key: socials.keys.create(name="drafts", scopes=["posts:write"], require_approval=True).

Metadata

Release files for socialsforai 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 socialsforai 0.1.0
File Size Uploaded Provenance Actions
socialsforai-0.1.0.tar.gz 16.9 kB Without provenance Details for socialsforai-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 35.0 kB

Release files / socialsforai-0.1.0.tar.gz

Download URL socialsforai-0.1.0.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b074f3c6e11f2398c3c9660299672ec2c066975652c4eb154c95358f1694798e
BLAKE2b-256 checksum
How to use checksums
9aafeea350ca03b04bec9bfdf50a56e3deece09c0cf56f677d1b489fa4b148d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL socialsforai-0.1.0-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0fe804ce5d65e6c0d0eca3b64edda4cc866d77f48d42c1c726d2d28209446f6
BLAKE2b-256 checksum
How to use checksums
b1aa6e6d714b7c7a8240b6cf8730e93a4a5ca89b49255383bb8b6b0f6976a5fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for socialsforai 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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