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 — every plan, including free, and not "all trends unlocked." Every plan reveals a daily, random, category-diversified budget of trend names (bigger on paid plans) — 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()
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)

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)

Every plan, including free. 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 (bigger budget on paid plans). 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
# }

get_full_trend(trend_id)

Every plan, including free. 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.1

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.1
File Size Uploaded Provenance Actions
earlyforge-0.1.1.tar.gz 6.0 kB Without provenance Details for earlyforge-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 11.7 kB

Release files / earlyforge-0.1.1.tar.gz

Download URL earlyforge-0.1.1.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1e65a7c49cf2d592c7f18ee7194366569de84ccc671f83da0ecf5840cb40f904
BLAKE2b-256 checksum
How to use checksums
ad606f2e8675e5e1b233e1ee6edbb2668c4ab5e89f6513ae145cc618f4b254b6
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.1-py3-none-any.whl

Download URL earlyforge-0.1.1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e93d31aec565571ddcda10ac06404319e3ec65a0096127b8e6d4269ef117dbf
BLAKE2b-256 checksum
How to use checksums
c077e55db1ce851e2f899afae3a37e0e4c68109f9eb1fbeb5a16930f27358a67
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.1

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