Needle

Connect AI Agents to
Needle

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

Back to Needle overview

Querying Specific Items by ID

Understanding Item IDs

Every piece of content on Hacker News—whether it's a story, comment, poll, or job posting—has a unique numerical identifier called an item ID. These IDs are assigned sequentially as content is created, making them a reliable way to reference specific items. When you need to retrieve precise information about a particular story or comment, querying by ID is the most direct and efficient approach.

How to Query Items by ID

The Needle Hacker News server makes it straightforward to retrieve specific items using their unique identifiers. Simply request the item you're interested in by providing its ID number. For example, you might ask your AI assistant to "get Hacker News item 34847201" or "show me details about item ID 34850000."

The server will return comprehensive information about the requested item, including:

  • Type: Whether it's a story, comment, poll, job posting, or other content type
  • Author: The username of who submitted or wrote it
  • Text content: For comments and text posts, the actual content
  • URL: For story submissions linking to external content
  • Score: The current point total from community voting
  • Timestamp: When the item was created
  • Parent and child relationships: For comments, which item they're responding to and any replies they've received

Where to Find Item IDs

Item IDs appear in several places throughout Hacker News:

In URLs: When browsing Hacker News, the item ID is typically visible in the page URL. A story might have a URL like news.ycombinator.com/item?id=34847201, where 34847201 is the item ID.

From other queries: When you retrieve lists of top stories, new submissions, or user activity, the server returns item IDs for each entry. You can then use these IDs to dig deeper into specific items that interest you.

In references: Comments and discussions often reference other posts. Once you have an ID from any source, you can query it directly.

Practical Applications

Querying by ID is particularly useful when you want to:

  • Track specific discussions: Monitor how a particular story's score or comment count evolves over time
  • Deep-dive into threads: Explore entire comment chains by starting with a parent comment's ID and following child relationships
  • Verify references: When someone mentions a specific post or comment, retrieve it directly to see the original context
  • Build collections: Maintain a list of important item IDs for later reference and batch retrieval

The ID-based querying system provides a foundation for precise, targeted access to Hacker News content, ensuring you can always return to specific items regardless of their current position in various feeds or listings.

Needle on Metorial

The Needle integration lets you search and retrieve relevant information from your personal knowledge base using AI-powered semantic search. Query your documents, notes, and stored content to get contextually relevant answers and citations directly within your workflow.

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