Skip to main content

earlyforge (Python)

EarlyForge is an AI-powered editorial intelligence platform that detects emerging trends across thousands of sources in 50 countries and turns them into original, sourced articles. This package gives you its trend data from code: see earlyforge.ai/developers.

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 earlyforge.ai/pulse: 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.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 earlyforge 0.1.2
File Size Uploaded Provenance Actions
earlyforge-0.1.2.tar.gz 6.3 kB Without provenance Details for earlyforge-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 12.2 kB

Release files / earlyforge-0.1.2.tar.gz

Download URL earlyforge-0.1.2.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
046fbb4a0c1b3a3392a090876a000e97a8eb99fecf4c18ea99a06824adae4614
BLAKE2b-256 checksum
How to use checksums
60cf5d1aff89c23319c2be5a36eda4f9db211a115206c39e9fee956fecde415c
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.2-py3-none-any.whl

Download URL earlyforge-0.1.2-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0ce9e922f9cecabcf537020359a9a6990c48f93b264b4c96ce0bcfc1f5d9598
BLAKE2b-256 checksum
How to use checksums
a34b2fab7aa4fd07d11defc8f5e393eaf330d2b55eaeb1d055bf936f255e494b
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.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