Hackernews

Connect AI Agents to
Hackernews

Automate workflows and connect AI agents to Hackernews. Metorial is built for developers. Handling OAuth, compliance, observability, and more.

Back to Hackernews overview

How to Search for Specific Stories and Comments by ID

Understanding Item IDs on Hacker News

Every story, comment, and poll on Hacker News has a unique numerical identifier called an item ID. These IDs are permanently assigned and never change, making them the most reliable way to access specific content. You'll often encounter these IDs in URLs when browsing Hacker News—for example, https://news.ycombinator.com/item?id=12345678 where 12345678 is the item ID.

Finding Item IDs

Before you can search by ID, you need to know which ID you're looking for. Item IDs appear in several places:

  • In URLs: When viewing any story or comment on Hacker News, the item ID appears in the browser's address bar
  • From Previous Queries: When you retrieve lists of top stories or new submissions through the server, each item includes its ID in the returned data
  • Shared Links: When someone shares a Hacker News discussion, the link contains the item ID

Retrieving Stories by ID

To access a specific story using its ID, simply ask your AI assistant to retrieve the Hacker News item with that ID number. For example, you might say "Get Hacker News item 12345678" or "Show me details for story ID 12345678."

The server will return comprehensive information about that story, including:

  • The title and URL of the submitted content
  • The author's username
  • The submission timestamp
  • Current score (upvotes)
  • Number of comments
  • The list of comment IDs attached to that story

This method is particularly useful when you want to revisit a specific discussion you encountered previously or when analyzing particular submissions for research purposes.

Retrieving Comments by ID

Comments work exactly the same way as stories—each has its own unique ID. When you retrieve a story, you'll receive a list of comment IDs associated with it. You can then request any specific comment using its ID.

To fetch a comment, ask for it by its item ID just as you would with a story. The returned data includes the comment text, author, timestamp, score, and any child comment IDs if it's part of a threaded discussion.

Why Search by ID?

Searching by ID offers several advantages:

  • Precision: You get exactly the item you want without ambiguity
  • Speed: Direct ID lookups are faster than searching by keywords
  • Reliability: IDs never change, unlike rankings or search results
  • Deep Linking: You can bookmark or reference specific discussions permanently

This method is essential for tracking ongoing discussions, conducting research on specific topics, or building your own analysis tools that need to reference particular Hacker News content consistently.

Hackernews on Metorial

The Hackernews integration lets you search and retrieve stories, comments, and user data from Hackernews directly within your workflow, enabling you to analyze trends, monitor discussions, and gather insights from the tech community.

Connect anything. Anywhere.

Ready to build with Metorial?

Let's take your AI-powered applications to the next level, together.

About Metorial

Metorial provides developers with instant access to 600+ MCP servers for building AI agents that can interact with real-world tools and services. Built on MCP, Metorial simplifies agent tool integration by offering pre-configured connections to popular platforms like Google Drive, Slack, GitHub, Notion, and hundreds of other APIs. Our platform supports all major AI agent frameworks—including LangChain, AutoGen, CrewAI, and LangGraph—enabling developers to add tool calling capabilities to their agents in just a few lines of code. By eliminating the need for custom integration code, Metorial helps AI developers move from prototype to production faster while maintaining security and reliability. Whether you're building autonomous research agents, customer service bots, or workflow automation tools, Metorial's MCP server library provides the integrations you need to connect your agents to the real world.

Star us on GitHub