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)
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, 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.2.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.2.0
File Size Uploaded Provenance Actions
wyro-0.2.0.tar.gz 15.1 kB With provenance Details for wyro-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 26.4 kB

Release files / wyro-0.2.0.tar.gz

Download URL wyro-0.2.0.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cc2fc1a78f56c1188d304e26e7493ed07ac968ca2ee6e8a79721836ddf55bf11
BLAKE2b-256 checksum
How to use checksums
a7ddc6d9d4e84cd2847dbc54bc3db6191fbef49457613fc61b1fe00cceb7ffcf
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 18, 2026.

Transparency log

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

Download URL wyro-0.2.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8112f8c242bc0e04a8eba6d3aab3839e9286f485cac027ca9188a75a6625df1b
BLAKE2b-256 checksum
How to use checksums
3ec10844db030438689cd2f9914fee6be8ace58c6dd212baa7b91e62d597a60c
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 18, 2026.

Transparency log

Security for wyro 0.2.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.2.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 18, 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