Sand AISand AI MAGI-2MAGI-2 est maintenant sur SandBase : vidéo 1080p avec audio natifEssayer maintenant

Hacker News Search

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

Prix
À partir de $0.0015USD / appel
Méthode
POST
Réponse
JSON
Paramètres
1 obligatoires · 1 facultatifs

Bac à sable

Entrée
Search keyword, e.g. "ai".
Optional result filter, e.g. "story" or "comment".
SortiePrêt

Votre sortie apparaîtra ici

Complétez les entrées, puis cliquez sur Exécuter.

README de l'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.

Explorer plus

APIs associées

Toutes les APIs
APIPrixRéponse
Hacker NewsÀ partir de $0.0015 par appelJSON
Hacker NewsÀ partir de $0.0015 par appelJSON
Hacker NewsÀ partir de $0.0015 par appelJSON
Hacker NewsÀ partir de $0.0015 par appelJSON

Questions

FAQ

Comment utiliser l’API Hacker News Search ?

Envoyez une requête POST à https://api.sandbase.ai/v1/api/hacker-news/search avec votre clé API SandBase dans l’en-tête Authorization (Bearer) et les paramètres dans un corps JSON. Vous pouvez aussi l’essayer dans le Playground sur cette page sans écrire de code.

Combien coûte l’API Hacker News Search ?

À partir de $0.0015 par appel, facturé depuis votre solde SandBase. Vous ne payez que les appels que vous effectuez ; aucun abonnement.

Quels paramètres l’API Hacker News Search accepte-t-elle ?

Obligatoire : query (string). Facultatif : tags (string). Le tableau des paramètres et le Playground sur cette page listent tous les champs.

Que renvoie l’API Hacker News Search ?

Une réponse JSON renvoyée dans la même requête HTTP (synchrone). Le README sur cette page inclut un exemple de réponse.

Ai-je besoin d’un compte développeur ou d’une clé API Hacker News ?

Non. Hacker News Search fonctionne via SandBase, donc une seule clé API SandBase couvre ce point de terminaison ainsi que toutes les autres API et tous les modèles du catalogue. Vous n’avez pas besoin de demander un accès API Hacker News séparément.