Sand AISand AI MAGI-2MAGI-2 ya está en SandBase: video en 1080p con audio nativoPruébalo ahora

Hacker News Search

Documentación de la API
https://api.sandbase.ai/v1/api/hacker-news/search

Search Hacker News by keyword - matching stories with title, link, author, points, and comment count as clean JSON.

Precio
Desde $0.0015USD / llamada
Método
POST
Respuesta
JSON
Parámetros
1 obligatorios · 1 opcionales

Entorno de pruebas

Entrada
Search keyword, e.g. "ai".
Optional result filter, e.g. "story" or "comment".
SalidaListo

Su salida aparecerá aquí

Complete las entradas y luego haga clic en Ejecutar.

README de la API

Hacker News Search API

Returns Hacker News items that match a keyword. Each result has the title, link, author, points, comment count, and creation time. The only required input is query.

Use cases

  • Track how often a topic such as AI reaches Hacker News and how many points those posts earn.
  • Find the most discussed Hacker News posts about a product or company name.
  • Collect source URLs shared on Hacker News for a keyword to build a reading list.
  • Filter results with tags to look only at stories or only at comments.

Request

curl -X POST "https://api.sandbase.ai/v1/api/hacker-news/search" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "ai"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
querystringYesSearch keyword, e.g. "ai".
tagsstringNoOptional result filter, e.g. "story" or "comment".

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": {
    "results": [
      {
        "author": "usefulposter",
        "comments": 1668,
        "createdUtc": 1773257369,
        "id": "47340079",
        "permalink": "https://news.ycombinator.com/item?id=47340079",
        "points": 4229,
        "title": "Don't post generated/AI-edited comments. HN is for conversation between humans",
        "url": "https://news.ycombinator.com/newsguidelines.html#generated"
      }
    ]
  },
  "found": true
}

Response fields

FieldMeaning
data.results[].titleTitle of the Hacker News post.
data.results[].urlLink the post points to. This is the external page or guideline the author shared.
data.results[].permalinkLink to the item's discussion page on Hacker News.
data.results[].idHacker News item ID, returned as a string.
data.results[].authorHacker News username of the person who posted the item.
data.results[].pointsScore of the post.
data.results[].commentsNumber of comments on the post.
data.results[].createdUtcCreation time as a Unix timestamp in seconds.
foundtrue when the search returned results.

Notes

Pricing

Billed at the actual cost of each call, about $0.0015 for the request above. Failed calls are not charged.

Explorar más

APIs relacionadas

Todas las APIs
APIPrecioRespuesta
Hacker NewsDesde $0.0015 por llamadaJSON
Hacker NewsDesde $0.0015 por llamadaJSON
Hacker NewsDesde $0.0015 por llamadaJSON
Hacker NewsDesde $0.0015 por llamadaJSON

Preguntas

FAQ

¿Cómo uso la API de Hacker News Search?

Envía una solicitud POST a https://api.sandbase.ai/v1/api/hacker-news/search con tu clave API de SandBase en el encabezado Authorization (Bearer) y los parámetros como un cuerpo JSON. También puedes probarlo en el Playground de esta página sin escribir código.

¿Cuánto cuesta la API de Hacker News Search?

Desde $0.0015 por llamada, facturado desde tu saldo de SandBase. Solo se te cobra por las llamadas que haces; no hay suscripción.

¿Qué parámetros acepta la API de Hacker News Search?

Requeridos: query (string). Opcionales: tags (string). La tabla de Parámetros y el Playground de esta página enumeran todos los campos.

¿Qué devuelve la API de Hacker News Search?

Una respuesta JSON devuelta en la misma solicitud HTTP (sincrónica). El README de esta página incluye una respuesta de ejemplo.

¿Necesito una cuenta de desarrollador o una clave API de Hacker News?

No. Hacker News Search funciona a través de SandBase, así que una sola clave API de SandBase cubre este endpoint y todas las demás APIs y modelos del catálogo. No necesitas solicitar acceso a la API de Hacker News por separado.