GET /v1/crawl/hackernews/search
Hacker News search API: full-text search over stories
Send search text in q and get the matching Hacker News stories from the Algolia search API, with their title, author, URL, points and highlight data. A search with no hits is not billed.
- Price
- $0.0005 per call
- Batch
- Yes, through /v1/batch
- Failed calls
- Not charged
Example request
curl
curl 'https://api.virev.ai/v1/crawl/hackernews/search?q=python' \
-H "Authorization: Bearer $VIREV_API_KEY"python
import os
import requests
response = requests.request(
"GET",
"https://api.virev.ai/v1/crawl/hackernews/search",
params={
"q": "python",
},
headers={"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"},
timeout=60,
)
response.raise_for_status()
print(response.json())Parameters
| Name | In | Type | Description |
|---|---|---|---|
q required | query | string | The search text. |
Example response
The example response of the API reference.
json
{
"data": {
"final_url": "https://hn.algolia.com/api/v1/search?query=python&tags=story",
"status": 200,
"content_type": "application/json",
"payload_kind": "json",
"response_headers": {
"content-type": "application/json"
},
"body": {
"exhaustive": {
"nbHits": false,
"typo": false
},
"exhaustiveNbHits": false,
"exhaustiveTypo": false,
"hits": [
{
"_highlightResult": {
"author": {
"matchLevel": "none",
"matchedWords": [],
"value": "todsacerdoti"
},
"title": {
"fullyHighlighted": false,
"matchLevel": "full",
"matchedWords": [
"python"
],
"value": "Uv is the best thing to happen to the <em>Python</em> ecosystem in a decade"
},
"url": {
"matchLevel": "none",
"matchedWords": [],
"value": "https://emily.space/posts/251023-uv"
}
},
"_tags": [
"story",
"author_todsacerdoti"
],
"author": "todsacerdoti",
"children": [
45751484,
45751497
],
"created_at": "2025-10-29T18:57:29Z",
"created_at_i": 1761764249,
"num_comments": 1324,
"objectID": "45751400",
"points": 2214,
"story_id": 45751400,
"title": "Uv is the best thing to happen to the Python ecosystem in a decade",
"updated_at": "2026-06-07T06:19:56Z",
"url": "https://emily.space/posts/251023-uv"
},
{
"_highlightResult": {
"author": {
"matchLevel": "none",
"matchedWords": [],
"value": "azizsaya"
},
"title": {
"fullyHighlighted": false,
"matchLevel": "full",
"matchedWords": [
"python"
],
"value": "Sunsetting <em>Python</em> 2"
},
"url": {
"fullyHighlighted": false,
"matchLevel": "full",
"matchedWords": [
"python"
],
"value": "https://www.<em>python</em>.org/doc/sunset-<em>python</em>-2/"
}
},
"_tags": [
"story",
"author_azizsaya"
],
"author": "azizsaya",
"children": [
20915983,
20916014
],
"created_at": "2019-09-09T06:43:24Z",
"created_at_i": 1568011404,
"num_comments": 704,
"objectID": "20915746",
"points": 1616,
"story_id": 20915746,
"title": "Sunsetting Python 2",
"updated_at": "2026-06-27T13:51:58Z",
"url": "https://www.python.org/doc/sunset-python-2/"
}
],
"hitsPerPage": 20,
"nbHits": 540030,
"nbPages": 50,
"page": 0,
"params": "query=python&tags=story&advancedSyntax=true&analyticsTags=backend",
"processingTimeMS": 9,
"processingTimingsMS": {
"_request": {
"roundTrip": 21
},
"fetch": {
"query": 2,
"scanning": 5,
"total": 8
},
"total": 9
},
"query": "python",
"serverTimeMS": 10
}
},
"meta": {
"cost": "$0.0005",
"balance": "$3.0775",
"request_id": "req_67a32bac1fcd620967b92dfd88b867e3"
}
}How it works
Full-text Hacker News search over stories, via the Algolia search API. A search with no hits is not billed.
Errors
| Status | When |
|---|---|
400 | The request parameters are invalid. |
401 | Missing, malformed, or revoked API key. |
402 | Balance is too low for this request. |
404 | The page does not exist: its site answered 404 or 410 for this input. You are not charged. |
429 | Over the per-minute limit. The limit belongs to your organization and all its API keys share it: 100 requests per minute unless an increase was granted. Wait for the Retry-After seconds, then retry. On a live read, code rate_limited means the platform itself rate-limited this read; retry after the Retry-After seconds. You are not charged. |
502 | The upstream fetch failed. You are not charged. |
503 | Billing could not be confirmed, so no upstream data was returned. |
504 | The upstream request timed out. You are not charged. |