{"uid":"cap_wA3gOTum7KCEk-fo9UXW2","slug":"hacker-news-stories-with-sentiment-api-2edac261","name":"Hacker News Stories with Sentiment API","description":"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).","url":"https://myearnings-seven.vercel.app/hackernews","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"count":{"type":"integer","description":"Number of stories to return (max 30)"}}},"responseSchema":{"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"}}}}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_jwqva122YuMLa_Rh9JAIQ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns top Hacker News stories with scores and sentiment analysis, fetched in real-time and gated by x402 micropayment","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Morning tech news briefing","prompt":"Give me the top 20 Hacker News stories this morning along with their scores and whether they're positive, negative, or neutral in tone."},{"title":"Positive-only HN digest","prompt":"Fetch 30 Hacker News stories and filter down to just the ones with positive sentiment — I want an uplifting tech news digest."},{"title":"Sentiment pulse on HN front page","prompt":"What's the overall mood on Hacker News right now? Get me 15 stories and break down how many are positive, negative, and neutral."}],"resultDescription":"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).","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T06:32:54.497Z","isFirstParty":false}