Skip to main content

earlyforge (Python)

Python client for the EarlyForge Trends API, with two tiers under the same /v1/api/trends/* prefix:

  • Pulse mirror — free on every account, no plan required. An authenticated mirror of the free, anonymous trend data already shown on pulse.earlyforge.ai: same daily snapshot, same trend count, same fields, no extra filters.
  • Full trends feed — paid plans only, and not "all trends unlocked." Every plan reveals a bigger, but still limited, daily, random, category-diversified budget of trend names — exactly what your organization's dashboard Trends page shows unlocked today, no more, no less. See full_trends() below.

This is not a client for articles, briefs, or alerts — the public API never exposes those on any plan.

Full reference: docs.earlyforge.ai/guides/api/python-sdk. Source: github.com/Earlyforge-official/earlyforge.

Install

Not published to PyPI yet. Contact support@earlyforge.ai for early access.

Quickstart

from earlyforge import PulseClient

client = PulseClient(api_key="ef_live_xxxxxxxxxxxxxxxx")

snapshot = client.top_trends(locale="fr")
print(snapshot["trends"][0]["display_name"])

Get a key from Settings → API Keys in the EarlyForge console — any account works, Pulse access is free.

Methods

top_trends(date=None, locale=None)

Global top trends — same snapshot as the Pulse homepage.

client.top_trends()
# {
#   "trends": [
#     {
#       "trend_id": "tr_a1b2c3",
#       "display_name": "AI regulation",
#       "region": "US",
#       "language": "en",
#       "categories": ["politics"],
#       "global_score": 87.5,
#       "lifecycle_stage": "growing",
#       "detected_at": "2026-11-04T08:00:00Z",
#       "hours_since_detection": 6.2,
#       "velocity_zscore": 2.1,
#       "acceleration": 0.4,
#       "n_sources": 12,
#       "source_diversity": 0.8,
#       "cross_lingual_root": false,
#       "google_trends_lead_hours": null,
#       "topic_class": null,
#       "entities": [],
#       "description": None
#     }
#   ],
#   "total": 20,
#   "cached_at": "2026-11-04T06:00:00Z",
#   "cache_ttl_seconds": 3600
# }

Top trends for an ISO 3166-1 alpha-2 region code (e.g. "US", "FR"). Same TrendList shape as top_trends.

Top trends for a category (e.g. "politics", "tech"). Same TrendList shape as top_trends.

get_trend(trend_id)

Detail for one trend. Same fields as a Trend, plus canonical_name, sources, a full description, and a timeline of {ts, score, sources_count} points.

client.get_trend("tr_a1b2c3")

full_trends(region=None, category=None, page=1, limit=20)

Paid plans only. A bigger, paginated slice of the trend corpus than the fixed Pulse snapshot — gated by the same daily random name-visibility budget as the dashboard. Items outside today's budget stay in the list with their name fields redacted (name_locked: true), not removed.

client.full_trends(limit=50)
# {
#   "items": [
#     {"trend_id": "tr_a1b2c3", "display_name": "Ransomware wave", ...},
#     {"trend_id": "tr_d4e5f6", "display_name": "••••••••••", "name_locked": True, ...}
#   ],
#   "total": 2,
#   "page": 1,
#   "per_page": 50
# }

A free-plan key raises PulseApiError with status_code=402 and detail={"error": "upgrade_required", ...} before this even runs.

get_full_trend(trend_id)

Paid plans only. Full detail for one trend — same TD-sourced fields as the dashboard's detail panel (topsis_score, editorial_title, etc.). Raises PulseApiError with status_code=402 and detail={"code": "trend_locked", ...} if the trend is outside today's visible-name budget.

client.get_full_trend("tr_a1b2c3")

Errors

Every non-2xx response raises earlyforge.PulseApiError with status_code and detail attributes (mirroring the OpenAPI spec's 401 missing/invalid/revoked key, 404 unknown trend, and 502 upstream unavailable responses). Network failures (DNS, timeout, connection refused) also raise PulseApiError.

from earlyforge import PulseApiError

try:
    client.get_trend("does-not-exist")
except PulseApiError as exc:
    print(exc.status_code, exc.detail)

Rate limits

No monthly call quota on this surface, for any plan — only the shared 60 requests/60s burst limit applies, same as the anonymous Pulse page.

Tests

pip install -e . pytest
pytest

Metadata

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

Built distribution (wheel)

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

Total release size: 11.9 kB

Release files / earlyforge-0.1.0.tar.gz

Download URL earlyforge-0.1.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
64c3fd901685506c86ebeeb55680b69134cd7a2bc42a2a8c5cb45d6e791b12fe
BLAKE2b-256 checksum
How to use checksums
db95d96a58744b9c164765a30182347ee6524e24d421096a1880869b7f93dc3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

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

Download URL earlyforge-0.1.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3655293529a2f18b7484aee62279eddaa60b444a7d8f8d59ed1257bbcf856460
BLAKE2b-256 checksum
How to use checksums
21383baa715013f011cd5d12e93467b3d80d5ab6e2ce96a0ec78af725c41190f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for earlyforge 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.

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