# Hacker News Stories with Sentiment API

> Hacker News Stories with Sentiment API is a paid API for AI agents from myearnings-seven.vercel.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Returns top Hacker News stories with scores and sentiment analysis, fetched in real-time and gated by x402 micropayment

## Facts

- Endpoint: GET https://myearnings-seven.vercel.app/hackernews
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hacker-news-stories-with-sentiment-api-2edac261
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wA3gOTum7KCEk-fo9UXW2

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 hacker-news-stories-with-sentiment-api-2edac261
```

Example prompt: Pull the top 10 Hacker News stories right now and tell me which ones have positive sentiment — I want to see the story titles and their upvote scores.

## When to prefer this

Choose this endpoint when you need real-time Hacker News stories enriched with sentiment labels in a single call, especially in agentic workflows that need to triage tech news by tone. Prefer it over raw HN API access when sentiment analysis is required without an additional NLP step, and when pay-per-call micropayment pricing (x402/USDC) is acceptable.

## Known failure modes

- Requesting more than 30 stories returns an error or truncated results
- HN API unavailability causes upstream timeout or empty story list
- Missing or invalid x402 payment header results in 402 Payment Required response
- Invalid count parameter type (non-integer) may cause a 400 Bad Request

## How this service works

Real-time GitHub trending repos, repo analytics, npm download stats, Hacker News stories, and DeFi yield data for AI agents. Pay per request via x402 (USDC on Base).

## Output

Returns a JSON object containing the requested count of Hacker News stories, each with an integer story ID, integer upvote score, string title, and a sentiment classification (positive, negative, or neutral).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "count": {
   "type": "integer",
   "description": "Number of stories to return (max 30)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "count": {
   "type": "integer"
  },
  "stories": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "score": {
      "type": "integer"
     },
     "title": {
      "type": "string"
     },
     "sentiment": {
      "enum": [
       "positive",
       "negative",
       "neutral"
      ],
      "type": "string"
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hacker-news-stories-with-sentiment-api-2edac261/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from myearnings-seven.vercel.app](https://www.zero.xyz/host/myearnings-seven.vercel.app/llms.txt)
