Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.tradingnews.press/llms.txt

Use this file to discover all available pages before exploring further.

AI Agent Skill

Copy the SKILL.md below into your project to teach AI coding agents how to use the TradingNews API. Works with Claude Code, Cursor, GitHub Copilot, and other AI tools.
---
name: tradingnews-api
description: |
  Use the TradingNews API to fetch real-time financial news for trading bots,
  market analysis, or portfolio monitoring. Trigger when the user wants to
  integrate financial news, build a news-driven trading bot, or connect to
  TradingNews.
---

Full Skill Content

TradingNews provides a unified, real-time financial news API. It aggregates breaking news from multiple curated sources into a single structured stream.

Base URL

https://api.tradingnews.press

Authentication

All requests require an API key via the X-API-Key header:
curl -H "X-API-Key: YOUR_KEY" https://api.tradingnews.press/v1/news
API keys are created in the TradingNews Dashboard after subscribing.

Plans

PlanPriceREST Rate LimitWebSocketSemantic SearchPer-Ticker Sentiment
Starter$20/mo1 req/minNoNoNo
Pro$50/mo30 req/minYes (1 connection)NoNo
MaxContact60 req/minYes (1 connection)YesYes
First-time subscribers get a 3-day free trial on Starter or Pro (Max excluded).

REST API

GET /v1/news — List articles

curl -H "X-API-Key: YOUR_KEY" \
  "https://api.tradingnews.press/v1/news?limit=5&urgency=breaking"
Query parameters:
  • limit (int, 1-100, default 50) — number of articles
  • urgency (string, optional) — filter: breaking, flash, or regular
  • since (ISO datetime, optional) — articles after this time (Starter: 24h max, Pro: 7 days max)
Response:
{
  "count": 2,
  "articles": [
    {
      "id": "01KNKV33C9DDADR1HRRWGCSA8V",
      "content": "Fed holds rates steady at 4.25-4.50%, signals patience on cuts",
      "urgency": "breaking",
      "sentiment": null,
      "published_at": "2026-04-07T14:30:00+00:00",
      "received_at": "2026-04-07T14:30:02+00:00"
    }
  ]
}
Article fields:
FieldTypeDescription
idstringUnique ULID, sortable by time
contentstringArticle text
urgencystringbreaking, flash, or regular
sentimentstring?Sentiment label (when available)
published_atstringISO 8601 publication time
received_atstringISO 8601 time API received it
tickersobject[]Max only. Per-ticker sentiment, e.g. [{"ticker": "AAPL", "sentiment": "positive"}]. Empty array when no tickers detected. Absent on Starter/Pro.
since lookback is capped at 24h for Starter and 7 days for Pro/Max.

GET /v1/news/search — Semantic search (Max only)

curl -H "X-API-Key: YOUR_KEY" \
  "https://api.tradingnews.press/v1/news/search?q=Fed%20rate%20decision&limit=5"
Query parameters:
  • q (string, 2-500 chars, required) — natural-language query
  • limit (int, 1-100, default 20)
Response:
{
  "count": 1,
  "query": "Fed rate decision",
  "articles": [
    {
      "id": "01KP8JCVDPYSS17HNRZPXNAZCP",
      "content": "Federal Reserve official Hammack ...",
      "urgency": "regular",
      "sentiment": null,
      "published_at": "2026-04-15T12:38:07+00:00",
      "received_at": "2026-04-15T12:38:28+00:00",
      "tickers": []
    }
  ]
}
Starter and Pro keys receive 403. Returns 503 if the embedding service is temporarily unavailable — retry with backoff.

GET /v1/account/usage — Check your plan

curl -H "X-API-Key: YOUR_KEY" \
  "https://api.tradingnews.press/v1/account/usage"
Response:
{
  "tier": "pro",
  "rate_limit": 30,
  "period_end": "2026-05-07T00:00:00+00:00"
}
tier is one of starter, pro, max, expired (7-day grace at 1 req/min after cancellation), or free (never subscribed — blocked from API access). This endpoint is free (does not count toward rate limit).

WebSocket Streaming (Pro and Max)

Connect for real-time push delivery of all articles as they arrive:
wss://api.tradingnews.press/v1/stream?api_key=YOUR_KEY
  • No subscription message needed — connect and receive (firehose)
  • Pro or Max plan required — Starter keys get rejected (code 1008)
  • 1 connection per user — second connection is rejected
  • Articles arrive as JSON, same format as REST
  • Max streams include the tickers field on each message; Pro streams omit it
  • Subscription status is re-checked every 5 minutes — expired subs are dropped with code 1008

Python example

import asyncio
import json
import websockets

async def stream():
    uri = "wss://api.tradingnews.press/v1/stream?api_key=YOUR_KEY"
    async with websockets.connect(uri) as ws:
        async for message in ws:
            article = json.loads(message)
            if article["urgency"] == "breaking":
                print(f"BREAKING: {article['content']}")

asyncio.run(stream())

Reconnection pattern

async def stream_with_reconnect():
    backoff = 1
    while True:
        try:
            async with websockets.connect(uri) as ws:
                backoff = 1
                async for msg in ws:
                    process(json.loads(msg))
        except websockets.ConnectionClosed:
            await asyncio.sleep(backoff)
            backoff = min(backoff * 2, 60)

Error Handling

StatusMeaningAction
401Invalid or missing API keyCheck X-API-Key header
403Subscription expired or inactive keyRenew subscription
404Article not foundNormal — no charge
429Rate limit exceededWait and retry

Python Integration Example

import httpx

client = httpx.Client(
    base_url="https://api.tradingnews.press",
    headers={"X-API-Key": "YOUR_KEY"},
)

# Get latest breaking news
response = client.get("/v1/news", params={"urgency": "breaking", "limit": 10})
articles = response.json()["articles"]

for article in articles:
    print(f"[{article['urgency']}] {article['content']}")

Node.js Integration Example

const response = await fetch("https://api.tradingnews.press/v1/news?limit=10", {
  headers: { "X-API-Key": "YOUR_KEY" },
});
const { articles } = await response.json();

articles.forEach((a) => {
  console.log(`[${a.urgency}] ${a.content}`);
});

Common Patterns

Poll for new articles (Starter)

import time
last_seen = None

while True:
    params = {"limit": 10}
    if last_seen:
        params["since"] = last_seen
    
    resp = client.get("/v1/news", params=params)
    articles = resp.json()["articles"]
    
    for article in articles:
        process(article)
        last_seen = article["received_at"]
    
    time.sleep(60)  # 1 req/min for Starter

News-driven trading signal

async for msg in ws:
    article = json.loads(msg)
    if article["urgency"] == "breaking":
        # Execute trade logic based on content
        execute_order(signal_from_content(article["content"]))

Docs & Support