# GET /news: $0.01 per call

Research any topic across Hacker News, Reddit, worldwide news sites (GDELT) and major outlets' headlines in one call: recent stories merged, de-duplicated and sorted newest first, with links, discussion threads, points, comment counts and outlets. Pass ?q=topic&days=7. For an AI-written summary with citations use /news/brief. No API keys needed.

- **Price:** $0.01 in USDC, the same on Base, Solana, Polygon, Arbitrum. Failed calls are never charged.
- **Free trial:** yes, 20 free calls a day from Claude, Cursor or any MCP client ([set-up](/mcp/setup)).
- **Tier:** cached
- **Answers cached for:** 10 min
- **Data sources:** HN Algolia (free); Reddit (free); GDELT (free); RSS headlines from BBC, Guardian, Ars Technica, NPR and others (free)
- **Lane:** Research & news ([OpenAPI](/openapi/research.json))
- **Live health:** [status page](/status)

## Free sample

See an answer for the demo input first, free (no payment, 10 a minute): [https://aayatai.com/sample/news](/sample/news). It is a stored real answer when we have one, otherwise an example marked `"kind": "illustrative"`.

```bash
curl "https://aayatai.com/sample/news"
```

## 1. See the price (free)

Call it without paying: you get `402 Payment Required` and a `PAYMENT-REQUIRED` header with the exact price and where to pay.

```bash
curl -i "https://aayatai.com/news?q=x402+payments&days=7"
```

## 2. Pay and call (TypeScript)

```bash
npm install @x402/fetch @x402/evm viem
```

```ts
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

// A wallet used only by your agent, holding a little USDC on Base.
const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const pay = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});

const res = await pay("https://aayatai.com/news?q=x402+payments&days=7");
console.log(await res.json());
```

## 3. Or as an MCP tool

```ts
// MCP server: https://aayatai.com/mcp (Streamable HTTP). With the x402 MCP client (see /start):
const result = await client.callTool("news", {"q":"x402 payments","days":7});
```

## Inputs

- `q` **(required)** (string): Topic or search words, e.g. x402 payments.
- `days` (integer; default `7`): How many days back to search (1-30).
- `limit` (integer; default `30`): Most items to return.
- `sources` (string): Comma list of hn, reddit, news, rss (default: all).

Bad inputs are rejected with HTTP 400 before any payment is asked for.

## Example answer

```json
{
  "query": "x402 payments",
  "days": 7,
  "items": [
    {
      "source": "hackernews",
      "title": "x402: an open payment protocol for the web",
      "url": "https://x402.org",
      "discussionUrl": "https://news.ycombinator.com/item?id=1",
      "publishedAt": "2026-09-27T10:15:00Z",
      "score": 312,
      "comments": 140,
      "outlet": "x402.org",
      "snippet": null
    }
  ],
  "total": 1,
  "sources": [
    {
      "name": "hn",
      "ok": true,
      "count": 1
    },
    {
      "name": "reddit",
      "ok": true,
      "count": 0
    },
    {
      "name": "news",
      "ok": true,
      "count": 0
    }
  ]
}
```

## Related

- [GET /news/brief](/services/news-brief) ($0.03): AI research brief on any topic from the last 1-30 days: gathers Hacker News, Reddit and worldwide news (GDELT), then writes a concise briefing (key developments

New here? [Getting started in 60 seconds](/start). All services: [Aayat AI](/).