SerenAI
SerenAI
Hacker News API on SerenAI x402 Gateway - Free API for AI Agents

Show HN: Free Hacker News API on SerenAI x402 Gateway

Taariq Lewis
Taariq Lewis
4 min read

AI agents can now query HN stories, comments, and users—and cross-reference with web scraping and AI search to build competitive intelligence tools.

Hacker News API on SerenAI x402 Gateway
Hacker News API on SerenAI x402 Gateway

What's New

We've added the official Hacker News API to the SerenAI x402 publisher as serendb.com/bestsellers/hacker-news-api. It's completely free. No payments required. AI agents can now access HN's real-time data through the same MCP interface they use for paid publishers.

Endpoints Available

EndpointDescription
/topstories.jsonTop 500 stories
/newstories.jsonNewest 500 stories
/beststories.jsonBest stories
/askstories.jsonAsk HN posts
/showstories.jsonShow HN posts
/jobstories.jsonJob postings
/item/{id}.jsonStory, comment, or poll by ID
/user/{username}.jsonUser profile with karma and submissions

Build This: Show HN Competitor Tracker

SerenAI hosts SerenCron LLM-invoked cronjobs, Firecrawl (YC-backed web scraping) and Perplexity (AI search). However, the emergent value-add for SerenAI is the composability of multiple publishers, and compute services, into a new service accessible by any LLM with MCP tooling. Combine SerenCron, Perplexity with Firecrawl and HN to build weekly, automated competitive intelligence.

The Product: Automated Competitor Monitoring

Imagine you're building a developer tool. You want to know when competitors launch on Show HN, when their products get upvoted in comments, what features they're shipping, and how the HN community reacts.

This isn't just Show HN tracking. Upvotes on links to competitor products anywhere on HN are a strong signal. A competitor's blog post hitting the front page with 200 points? That's market intelligence you need to act on.

Architecture

Show HN Competitor Tracker Architecture
Show HN Competitor Tracker Architecture

How It Works

  1. Define competitors — Create a watchlist of domains and keywords
  2. Monitor Show HN — Query /showstories.json for launches, check URLs against your list
  3. Track upvotes — Scan /topstories.json for links to competitor domains (200 points on a competitor blog post = significant signal)
  4. Enrich with Firecrawl — Scrape landing pages for pricing, features, positioning changes
  5. Analyze with Perplexity — Get AI-powered competitive comparisons
  6. Automate with SerenCron — Hourly checks, daily digests, weekly deep-dives

Example Prompt

text
1Using SerenAI x402:
2
3My competitors are: RapidAPI (rapidapi.com), Hugging Face (huggingface.co)
4
51. Query Hacker News /topstories.json and /showstories.json
62. Find any stories linking to competitor domains or mentioning their names
73. For each match, get the story details: title, URL, score (upvotes), comment count
84. Use Firecrawl to scrape each competitor's landing page and changelog
95. Use Perplexity to answer: "What new features have these competitors launched recently? How does HN sentiment compare?"
106. Generate a competitive intelligence report with:
11   - HN mentions ranked by upvotes
12   - Feature updates from their sites
13   - Community sentiment summary
14
15I want this as a weekly digest.

Cost Analysis

Check TypeHN APIFirecrawlPerplexitySerenCronMonthly
Show HN scan (hourly)Free$0.00001~$0.01
Top stories scan (hourly)Free$0.00001~$0.01
Landing page scrape$0.002~$0.12
Competitive analysis (daily)$0.005$0.00001~$0.15
Total~$0.20

Ship It As

  • SaaS Dashboard: $1/mo for founders tracking 5 competitors
  • Slack Bot: Real-time alerts when competitors hit HN
  • Weekly Newsletter: Curated competitive intel for your industry

Quick Start

Install the x402 MCP Server

GitHub: github.com/serenorg/x402-mcp-server

bash
1npx @serendb/x402-mcp-server

Or add to Claude Code:

bash
1claude mcp add x402 -- npx @serendb/x402-mcp-server

Via x402 MCP Server

json
1// Get HN publisher details
2mcp__x402__get_publisher_details { "publisher_id": "af2d7cbb-ca72-4031-9bbb-78c2cce6846e" }
3
4// Query top stories
5mcp__x402__pay_for_query {
6  "publisher_id": "af2d7cbb-ca72-4031-9bbb-78c2cce6846e",
7  "request": { "method": "GET", "path": "/topstories.json" }
8}
9
10// Get story details with score (upvotes)
11mcp__x402__pay_for_query {
12  "publisher_id": "af2d7cbb-ca72-4031-9bbb-78c2cce6846e",
13  "request": { "method": "GET", "path": "/item/12345678.json" }
14}

Via cURL

bash
1curl -X POST https://x402.serendb.com/api/proxy \
2  -H "Content-Type: application/json" \
3  -d '{
4    "publisherId": "af2d7cbb-ca72-4031-9bbb-78c2cce6846e",
5    "request": { "method": "GET", "path": "/topstories.json" }
6  }'

Automate with SerenCron

Schedule weekly competitive scans via MCP:

json
1// Create weekly cron job (Monday 9 AM ET)
2mcp__x402__pay_for_query {
3  "publisher_id": "fdefd4a0-7a8b-4fb7-86d7-ec5b6ca69f19",
4  "request": {
5    "method": "POST",
6    "path": "/api/v1/jobs",
7    "body": {
8      "name": "weekly-hn-competitor-scan",
9      "url": "https://news.ycombinator.com/topstories.json",
10      "method": "GET",
11      "cron_expression": "0 9 * * 1",
12      "timezone": "America/New_York"
13    }
14  }
15}
16
17// View stored results anytime
18mcp__x402__pay_for_query {
19  "publisher_id": "fdefd4a0-7a8b-4fb7-86d7-ec5b6ca69f19",
20  "request": { "method": "GET", "path": "/api/v1/jobs/{job_id}/results" }
21}

Results are stored and retrievable via SerenCron.

Cost: $0.00001/execution = ~$0.00004/month for weekly scans.

Why Free?

Hacker News API is public—no API key required. We're not adding a toll to free data. Instead, we're making HN accessible through the same interface agents use for paid publishers, enabling cross-analysis workflows without switching contexts.

The value is in composability with both free and paid sources. An agent tracking competitors can pull HN discussions (free), scrape competitor sites with Firecrawl (paid), then get AI analysis from Perplexity (paid)—all through one protocol.

About SerenAI

SerenAI - Payment Infrastructure for the AI Agent Economy
SerenAI - Payment Infrastructure for the AI Agent Economy

SerenAI is building payment infrastructure for the AI agent economy. Our x402 Gateway enables AI agents to autonomously pay for data and services using USDC micropayments on Base—no subscriptions, no API keys, no human intervention.

Our Stack: TypeScript, Rust, PostgreSQL, Cloudflare Workers, Base (Ethereum L2), Coinbase x402 Protocol

Data Publishers: Firecrawl, Perplexity, OpenAI, Exa, Google Trends, SEC Filings, Hacker News, crates.io, and 35+ more

Ready to build? Sign up at console.serendb.com/signup with invite code serenai2025

Questions? Email hello@serendb.com or join our Discord.

Share:Subscribe
Taariq Lewis

About Taariq Lewis

Exploring how to make developers faster and more productive with AI agents

Related Posts