# GET /trends: $0.03 per call

Is interest in a topic rising or falling? Three free public signals in one call: Wikipedia page views (daily), news article volume worldwide (GDELT, daily) and Hacker News stories (weekly), each with its total and change over the window, plus an overall verdict. A free stand-in for Google Trends. Pass ?topic=AI agents&days=30 (up to 90).

- **Price:** $0.03 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)).
- **Answers cached for:** 3 hour(s)
- **Data sources:** Wikimedia Pageviews (CC0); GDELT news volume (free); Hacker News via Algolia (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/trends](/sample/trends). It is a stored real answer when we have one, otherwise an example marked `"kind": "illustrative"`.

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

## 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/trends?topic=Kubernetes&days=28"
```

## 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/trends?topic=Kubernetes&days=28");
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("trends", {"topic":"Kubernetes","days":28});
```

## Inputs

- `topic` **(required)** (string): Topic, product or company, e.g. AI agents, Kubernetes, Stripe.
- `days` (integer; default `30`): Window in days (14 to 90).
- `wikipedia_article` (string): Exact English Wikipedia title if it differs from the topic, e.g. Intelligent agent.
- `detail` (string; one of `full`, `brief`; default `full`): brief = key fields only (same price)

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

## Example answer

Example only: the shape of an answer, with placeholder addresses and made-up figures. It is not data about any real token or wallet; call the service (or its free sample) for real results.

```json
{
  "topic": "Kubernetes",
  "days": 28,
  "verdict": "steady",
  "wikipedia": {
    "article": "Kubernetes",
    "series": [
      {
        "date": "2026-09-02",
        "count": 936
      }
    ],
    "total": 24500,
    "changePct": 20.2,
    "direction": "rising"
  },
  "news": null,
  "hackerNews": {
    "series": [
      {
        "date": "2026-09-02",
        "count": 11
      }
    ],
    "total": 44,
    "changePct": -8.7,
    "direction": "steady"
  },
  "unavailable": {
    "news": "The data source (api.gdeltproject.org) took too long."
  },
  "note": "changePct compares the second half of the window with the first; direction is rising/falling beyond ±15%. (Series shortened in this example.)",
  "source": "Wikimedia Pageviews (CC0); GDELT Project; Hacker News via Algolia"
}
```

## Related

- [GET /news](/services/news) ($0.01): Research any topic across Hacker News and headlines from major outlets (BBC, Guardian, Ars Technica, TechCrunch, crypto news and more), Lobsters, Lemmy and DEV 
- [GET /news/brief](/services/news-brief) ($0.03): AI research brief on any topic from the last 1-30 days: gathers Hacker News and headlines from major outlets, Lobsters, Lemmy and DEV, then writes a concise bri
- [GET /wikipedia/pageviews](/services/wiki-pageviews) ($0.002): Daily Wikipedia page views for any article between two dates: a free, public measure of how much interest a topic, company, person of note or product is getting

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