Skip to main content

wyro (Python)

Official Python client for the wyro API: publish and schedule posts on Instagram, Facebook, TikTok, LinkedIn, X, Threads, YouTube and Pinterest from your app or agent.

  • Python 3.9+, no dependencies (standard library urllib), typed (TypedDict, py.typed).
  • Retries on 429 and 5xx, honoring Retry-After. Creates are only retried when you pass an idempotency_key.
  • Typed errors (WyroError) with code, message, fix and details.
  • Webhook signature verification.

Quick start

import os, uuid
from wyro import Wyro

wyro = Wyro(api_key=os.environ["WYRO_API_KEY"])  # no key yet? POST https://wyroapi.com/v1/sandbox

post = wyro.posts.create(
    {"text": "Launching something new", "platforms": ["instagram", "linkedin"], "media": [{"url": "https://…/a.jpg"}]},
    idempotency_key=str(uuid.uuid4()),
)
print(post["status"], post["preview_url"])

Resources

Posts posts.create(post, idempotency_key=…) (with overrides, first_comment, queue), posts.get(id), posts.list(limit=, cursor=), posts.iterate(), posts.reschedule(id, when), posts.cancel(id), posts.bulk(csv, dry_run=False)
Queue queue.get(), queue.set(slots, timezone=None), queue.next(count)
Limited keys keys.create(scopes, name=None), keys.list(), keys.revoke(id)
Accounts accounts.list(), accounts.disconnect(id), accounts.metrics(id, since=None, until=None)
Metrics posts.metrics(id, refresh=False) (per network, 1 h cache, simulated in test mode), accounts.metrics(...), analytics.overview(since=None, until=None) (with performance)
Connect connect(platform, return_url=None, idempotency_key=…)
Media media.upload(data, content_type, filename, uploader=None), media.upload_small(...), media.create_upload(...)
Webhooks webhooks.set(url), webhooks.get(), webhooks.delete()
Partners partner.workspaces.create/list/get/delete/rotate_key/create_key/list_keys, partner.usage(external_id=None), for_client(external_id)

Files over 4 MB get an upload ticket (media.create_upload); pass uploader(ticket, data, auth_headers) -> url to media.upload to send the bytes where the ticket says.

Partners

wyro = Wyro(partner_token=os.environ["WYRO_PARTNER_TOKEN"])
wyro.partner.workspaces.create("client-123", idempotency_key="create-client-123")

client = wyro.for_client("client-123")  # sends X-Wyro-External-Id
client.connect("instagram", "https://yourapp.com/integrations")

Errors

from wyro import WyroError

try:
    wyro.posts.create({"text": "Hello", "platforms": ["linkedin"]})
except WyroError as e:
    if e.code == "duplicate_post":
        print("Already posted:", e.details["existing_post_id"])
    else:
        raise

Webhooks

from wyro import verify_signature

# raw_body: the request body exactly as received (bytes or str)
ok = verify_signature(secret, request.headers["X-Wyro-Timestamp"], raw_body, request.headers["X-Wyro-Signature"])

Dedupe events on id: retries (header X-Wyro-Attempt) keep the same id. Contract: https://wyroapi.com/en/docs/webhooks

Tests

pip install pytest && pytest

Español

SDK oficial de Python para la API de wyro. Sin dependencias, con tipos, reintentos ante 429 y 5xx (respetando Retry-After; las creaciones solo se reintentan con idempotency_key), errores tipados (WyroError con code, message, fix) y verificación de firmas de webhooks (verify_signature).

from wyro import Wyro

wyro = Wyro(api_key=os.environ["WYRO_API_KEY"])
post = wyro.posts.create({"text": "Lanzamos algo nuevo", "platforms": ["instagram"], "media": [{"url": "https://…"}]}, idempotency_key=str(uuid.uuid4()))

Documentación: https://wyroapi.com/docs/sdks

License

MIT

Metadata

Release files for wyro 0.3.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 wyro 0.3.0
File Size Uploaded Provenance Actions
wyro-0.3.0.tar.gz 16.8 kB With provenance Details for wyro-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 29.2 kB

Release files / wyro-0.3.0.tar.gz

Download URL wyro-0.3.0.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a876919e7a2ea8d8fc13f2a6fa3ace319afe7a6956574709c869f512c38ad2a2
BLAKE2b-256 checksum
How to use checksums
b898b39ea0ae26d698a1d193f0dc17cf735449db989d4fd3759619f050082042
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / wyro-0.3.0-py3-none-any.whl

Download URL wyro-0.3.0-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5db78d5393bd04fac89eb5a20a171d8092fbad59390a9969954e626f44ca4f3
BLAKE2b-256 checksum
How to use checksums
501dc12c4e05fd34ce24992e690ac520111481a7ced29b773e77fb641876ee6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for wyro 0.3.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wyro-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

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.

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