Skip to main content

Official Python client for the Storyflo audio news API

Project description

storyflo (Python)

Official Python client for the Storyflo audio news API. Wraps the six agent tools across all three protocols (public REST, OAuth 2.1, x402 micropayments).

pip install storyflo

Usage

from storyflo import StoryfloClient

# Public read — no auth, rate-limited per IP.
sf = StoryfloClient()

trending = sf.search_articles(vertical="tech", limit=5)
for a in trending["articles"]:
    audio = sf.get_audio_url(a["slug"])
    print(f"{a['title']}{audio['audio_url']}")

OAuth (Claude / ChatGPT agents)

import os

sf = StoryfloClient(auth=("bearer", os.environ["STORYFLO_OAUTH_TOKEN"]))

sf.subscribe_topic(["tech", "finance"])
digest = sf.digest(window="24h", limit=5)

x402 micropayments (Coinbase AgentKit)

# `payment_header` is the base64-encoded EIP-712 authorization the
# AgentKit produces on settle. Each call costs $0.001-$0.30 USDC.
sf = StoryfloClient(auth=("x402", payment_header))
article = sf.get_article("interest-rates-q1")

API

Method Tool Auth required
search_articles(...) search_articles none / x402
get_article(slug) get_article none / x402
get_audio_url(slug) get_audio_url OAuth / x402
subscribe_topic(verticals) subscribe_topic OAuth (write scope)
list_subscriptions() list_subscriptions OAuth (read scope)
digest(window, limit, ...) digest OAuth / x402

Errors raise StoryfloError with .status and parsed .body.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

storyflo-1.0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

storyflo-1.0.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file storyflo-1.0.1.tar.gz.

File metadata

  • Download URL: storyflo-1.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for storyflo-1.0.1.tar.gz
Algorithm Hash digest
SHA256 600dd4864c990291482267532396c78f6cb29ba06cf02c1b3ad842639b24878d
MD5 9d1e7053836621427ec135b0bf760654
BLAKE2b-256 d43d3b01fb6481f1d43dd677fa0e643c40a41c344b961e0941bc07028ea25174

See more details on using hashes here.

File details

Details for the file storyflo-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: storyflo-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for storyflo-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9832e06c82f224b7628e689fb7d6a89b547e4d70b373b532a5b39ab9d51232f6
MD5 af734ac10aa843449fc31f95855fe3e6
BLAKE2b-256 9f51fe0ccdb32b817ff4e826fbe2bb954534c6788c7d016d1a2d2d541a710a11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page