Sand AISand AI MAGI-2MAGI-2 agora está na SandBase: vídeo em 1080p com áudio nativoExperimente agora

Hacker News Search

Docs da 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.

Preço
A partir de $0.0015USD / chamada
Método
POST
Resposta
JSON
Parâmetros
1 obrigatórios · 1 opcionais

Playground

Entrada
Search keyword, e.g. "ai".
Optional result filter, e.g. "story" or "comment".
SaídaPronto

Sua saída aparecerá aqui

Preencha as entradas e clique em Executar.

README da 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 mais

APIs relacionadas

Todas as APIs
APIPreçoResposta
Hacker NewsA partir de $0.0015 por chamadaJSON
Hacker NewsA partir de $0.0015 por chamadaJSON
Hacker NewsA partir de $0.0015 por chamadaJSON
Hacker NewsA partir de $0.0015 por chamadaJSON

Perguntas

FAQ

Como eu uso a API Hacker News Search?

Envie uma solicitação POST para https://api.sandbase.ai/v1/api/hacker-news/search com sua chave de API da SandBase no cabeçalho Authorization (Bearer) e os parâmetros no corpo JSON. Você também pode testar no Playground desta página sem escrever código.

Quanto custa a API Hacker News Search?

A partir de $0.0015 por chamada, cobrado do seu saldo SandBase. Você paga apenas pelas chamadas que fizer; não há assinatura.

Quais parâmetros a API Hacker News Search aceita?

Obrigatórios: query (string). Opcionais: tags (string). A tabela de Parâmetros e o Playground nesta página listam todos os campos.

O que a API Hacker News Search retorna?

Uma resposta JSON retornada na mesma solicitação HTTP (síncrona). O README desta página inclui um exemplo de resposta.

Preciso de uma conta de desenvolvedor Hacker News ou de uma chave de API?

Não. Hacker News Search funciona via SandBase, então uma única chave de API da SandBase cobre este endpoint e todas as outras APIs e modelos do catálogo. Você não precisa solicitar acesso à API do Hacker News separadamente.