Skip to main content

live-earnings

Python client for the Live Earnings API: live earnings-call transcripts, each turn's text as it is spoken and then who said it. Python 3.9+.

Install

pip install live-earnings

Quickstart

Your API key (ek_…) covers one call; copy it from the call's API Access tab on https://live-earnings.com/live. Run with LE_KEY=ek_… SLUG=<call-slug>:

import os
import time

from live_earnings import LiveEarningsClient, LiveEarningsError, Transcript

client = LiveEarningsClient(token=os.environ["LE_KEY"])
slug = os.environ["SLUG"]
transcript = Transcript()


def show(turn):
    if turn:
        print(f"{turn.name or '…'}: {turn.text or ''}")


# Everything so far…
last = None  # the last seq seen; None = start the stream from now
ended = False
for env in client.events(slug):
    show(transcript.apply(env))
    last = env.seq
    ended = ended or env.event.type == "done"
# …then live until the call ends. Connections drop (and are cut after an
# hour), so reconnect from the last seq seen; the server replays the gap.
while not ended:
    try:
        for env in client.stream(slug, last_event_id=last):
            if env.event.type == "done":
                ended = True
                break
            show(transcript.apply(env))
            last = env.seq
    except LiveEarningsError as err:
        # A 4xx (bad key, wrong call) will not fix itself; anything else might.
        if 400 <= err.status < 500 and err.status != 429:
            raise
    if not ended:
        time.sleep(2)

A turn prints once when its text arrives (…: text) and again when its speaker is named. Transcript applies the rules: a person's correction beats the model's name, new_name == "unknown" leaves a turn unnamed, basis == "early" marks a provisional name, and a repeated envelope is ignored. apply() returns the turn itself, updated in place as later events arrive.

The client

meta(slug) the call: ticker, fiscal period, status, roster
events(slug, from_=None, to=None, limit=None) every stored envelope, following pagination
stream(slug, last_event_id=None) live envelopes; raises if the connection goes silent for 90 s — resume with the last seq you saw
session_token(slug) a SessionToken (session_token, expires_in) for a browser EventSource (?t=) — call it on your server

Hosts default to https://live-earnings.com (REST) and https://stream.live-earnings.com (streams); override with base_url and stream_url. Both must be https:// unless you pass allow_insecure=True for local development. Errors raise LiveEarningsError (status, body).

Full reference: https://live-earnings.com/live/docs

Changes

0.4.2 — CallMeta.company_logo_url: the company logo as a site-relative path (resolve against your base_url); None when the call has none. Also CallMeta.listed (published on the account-level MCP endpoint) and CallMeta.timing ("upcoming", "live" or "past"). stream() on a call the server has no live stream for (over, or scheduled long ago and never started) now raises LiveEarningsError with status 204; it used to end silently with no events. Read the transcript with events() instead.

0.4.1 — No API change. The quickstart reconnects until the call ends (streams are cut after an hour) and never resumes from seq 0.

0.4.0 — Default hosts (base_url is optional; streams go to the stream host). Transcript folds events into turns. session_token(). events() takes an optional range. Streams deliver each message as it arrives (they were buffered in 512-byte reads). AiInsightEvent is deprecated — the API does not currently send it.

0.3.0 — UnknownEvent.naming == "pending" (the name follows as a TurnSpeakerAmendEvent); amends carry by and may carry basis == "early".

0.2.0 — stt_speaker_change on AttributionEvent and UnknownEvent; ai_insight and turn_speaker_amend decode to their own classes.

Metadata

Release files for live-earnings 0.4.2

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

Source distribution (sdist)

Source distribution for live-earnings 0.4.2
File Size Uploaded Provenance Actions
live_earnings-0.4.2.tar.gz 15.7 kB Without provenance Details for live_earnings-0.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for live-earnings 0.4.2
File Interpreter ABI Platform Actions
live_earnings-0.4.2-py3-none-any.whl Python 3 none any Details for live_earnings-0.4.2-py3-none-any.whl

Total release size: 28.6 kB

Release files / live_earnings-0.4.2.tar.gz

Download URL live_earnings-0.4.2.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4773d4d9013fa31f349267a5f70e54c86f5d7ebf063489ec51a9bc97d1729766
BLAKE2b-256 checksum
How to use checksums
8a270beee10774d7a41cde44133bd8f15fd6aac9ac5960b18b6906b915f8b3f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / live_earnings-0.4.2-py3-none-any.whl

Download URL live_earnings-0.4.2-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78ce2530ec3759c90a3c801b6e7e6a9eb6547b92cf8be95541c49eb68947f26f
BLAKE2b-256 checksum
How to use checksums
d0476c8858e294fbb2e70d5c4ef835a5a938727603c0a73a637a04b1d1b5e568
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for live-earnings 0.4.2

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.

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