> ## 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.

# Quickstart

> Get your first API response in under 2 minutes

## 1. Get your API key

Sign up at [tradingnews.press](https://tradingnews.press) and create an API key from your [dashboard](https://tradingnews.press/dashboard/keys).

Your key looks like: `tn_live_a8f3k2m1n...`

## 2. Make your first request

<CodeGroup>
  ```bash cURL theme={null}
  curl -H "X-API-Key: YOUR_KEY" \
    "https://api.tradingnews.press/v1/news?limit=5"
  ```

  ```python Python theme={null}
  import httpx

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

  response = client.get("/v1/news", params={"limit": 5})
  articles = response.json()["articles"]

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

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.tradingnews.press/v1/news?limit=5", {
    headers: { "X-API-Key": "YOUR_KEY" }
  });

  const { articles } = await response.json();
  articles.forEach(a => {
    console.log(`[${a.urgency}] ${a.content}`);
  });
  ```
</CodeGroup>

## 3. Stream real-time news

Connect via WebSocket for live updates (Pro and Max plans):

<CodeGroup>
  ```python Python theme={null}
  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:
          # Firehose — all articles are pushed automatically
          async for message in ws:
              article = json.loads(message)
              print(f"[{article['urgency']}] {article['content']}")

  asyncio.run(stream())
  ```

  ```javascript Node.js theme={null}
  const ws = new WebSocket("wss://api.tradingnews.press/v1/stream?api_key=YOUR_KEY");

  // Firehose — all articles are pushed automatically
  ws.onmessage = (event) => {
    const article = JSON.parse(event.data);
    console.log(`[${article.urgency}] ${article.content}`);
  };
  ```
</CodeGroup>

## 4. Check your usage

```bash theme={null}
curl -H "X-API-Key: YOUR_KEY" \
  "https://api.tradingnews.press/v1/account/usage"
```

```json theme={null}
{
  "tier": "starter",
  "rate_limit": 1,
  "period_end": "2026-05-07T00:00:00Z"
}
```

## Next steps

* [Authentication](/authentication) — API key best practices
* [API Reference](/api-reference/overview) — Full endpoint documentation
* [Rate Limits](/concepts/rate-limits) — Request limits per plan
