# News Sentiment Analysis API

> News Sentiment Analysis API is a paid API for AI agents from freetier-agent-api.pages.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-20).

Analyzes news sentiment for a given topic, company, or person over a configurable timespan, returning a sentiment label, trend direction, average tone, and a daily timeline of tone scores.

## Facts

- Endpoint: GET https://freetier-agent-api.pages.dev/api/news-sentiment?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/news-sentiment-analysis-api-18592ae6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_nHjw6Kol5emu61m4PSXLR

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability news-sentiment-analysis-api-18592ae6
```

Example prompt: What's the news sentiment around Nvidia right now — is it positive or negative, and has the tone been improving or getting worse over the past 7 days?

## When to prefer this

Use this endpoint when you need structured, quantified news sentiment for a specific topic, company, or person — especially when you want both a summary label and a daily trend timeline. Prefer this over generic web search when you need a numerical tone score and trend direction rather than raw article content, or when you want to monitor sentiment changes over a configurable window (24h, 7d, 2w).

## Known failure modes

- Missing required 'q' parameter returns an error
- Invalid timespan format (e.g. unsupported units) may return default or error
- Obscure topics with little news coverage may return sparse or empty timeline
- Unsupported language codes may fall back to default or return error
- Rate limiting or x402 payment failure blocks access to the endpoint

## How this service works

Invoice-to-JSON, on-chain tools (transaction explainer + payment check, wallet profile, contract ABI, ERC-20 token risk), company contacts and web-to-RAG for AI agents. Pay per call with x402 (USDC on Base). No signup, no API key.

## Output

A JSON object with a sentiment label (e.g. 'slightly-negative', 'positive'), the query term, a trend direction string (e.g. 'improving'), an average tone score (float), and a timeline array of daily date/tone objects showing how sentiment has shifted over the requested period.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "q"
     ],
     "properties": {
      "q": {
       "type": "string",
       "description": "topic, company or person"
      },
      "lang": {
       "type": "string",
       "description": "optional source language"
      },
      "timespan": {
       "type": "string",
       "description": "e.g. 24h, 7d, 2w (default 7d)"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "label": "slightly-negative",
  "query": "Bitcoin",
  "trend": "improving",
  "timeline": [
   {
    "date": "2026-10-28T00:00:00Z",
    "tone": -1.2
   }
  ],
  "averageTone": -0.8
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/news-sentiment-analysis-api-18592ae6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from freetier-agent-api.pages.dev](https://www.zero.xyz/host/freetier-agent-api.pages.dev/llms.txt)
