---
title: "Discussions"
method: POST
path: "/discussions"
tags: ["Search"]
---

# Discussions

`POST /discussions`

## Request

- Base URL: `https://api.weblens.dev`
- URL: `https://api.weblens.dev/discussions`
- Auth: API key in header `Payment-Signature`

What Hacker News said about a topic: matching stories with points, comment counts and links to the threads, plus aggregates — total matches, points and comments returned, the domains most often submitted, and the first/last time it was discussed. Price: $0.004.

## Request body

- object
  - `query` string, required: What to search Hacker News for
  - `limit` number: Stories to return (1-50, default 10)
  - `sort` 'relevance' | 'recent': Rank by relevance (default) or newest first

## Response `200`

What Hacker News said about a topic, with points, comments and aggregates.

- object
  - `query` string
  - `source` 'hackernews'
  - `sort` string
  - `stories` object[]: Each: title, url, points, comments, author, postedAt, discussionUrl
    - `title` string
    - `url` string
    - `points` integer
    - `comments` integer
    - `author` string
    - `postedAt` string
    - `discussionUrl` string: Link to the HN thread
  - `summary` object: totalMatches, returned, pointsReturned, commentsReturned, topDomains, firstSeen, lastSeen
    - `totalMatches` integer: Stories HN matched overall, which may exceed those returned
    - `returned` integer
    - `pointsReturned` integer: Summed over the RETURNED stories only
    - `commentsReturned` integer: Summed over the RETURNED stories only
    - `topDomains` unknown[]: Most-submitted domains among the returned stories
      - unknown
    - `firstSeen` string
    - `lastSeen` string
  - `discussedAt` string
  - `requestId` string

## Other responses

- `400`: The body failed validation
- `402`: Payment required — x402 v2 protocol. Parse the PAYMENT-REQUIRED response header (base64-encoded JSON), sign the payment with your wallet, then retry the request with the Payment-Signature request header.

---

[API](https://skmtc.dev/weblens/apis/weblens-api.md) · [All operations](https://skmtc.dev/weblens/apis/weblens-api/llms.txt) · [OpenAPI document](https://skmtc.dev/weblens/apis/weblens-api/revisions/63a7e81b6921?raw)
