GET /v1/crawl/hackernews/story
Hacker News item API: story, comment, poll or job by id
Send a numeric Hacker News item id in id and get that item, a story, comment, poll or job, with its author, score, time, title, URL and the ids of its replies. An id with no item returns no fields and 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/story?id=8863' \
-H "Authorization: Bearer $VIREV_API_KEY"python
import os
import requests
response = requests.request(
"GET",
"https://api.virev.ai/v1/crawl/hackernews/story",
params={
"id": "8863",
},
headers={"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"},
timeout=60,
)
response.raise_for_status()
print(response.json())Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | query | string | The Hacker News item id (numeric). |
Example response
The example response of the API reference.
json
{
"data": {
"final_url": "https://hacker-news.firebaseio.com/v0/item/8863.json",
"status": 200,
"content_type": "application/json; charset=utf-8",
"payload_kind": "json",
"response_headers": {
"content-type": "application/json; charset=utf-8",
"cache-control": "no-cache"
},
"body": {
"by": "dhouston",
"descendants": 71,
"id": 8863,
"kids": [
9224,
8917
],
"score": 104,
"time": 1175714200,
"title": "My YC app: Dropbox - Throw away your USB drive",
"type": "story",
"url": "http://www.getdropbox.com/u/2/screencast.html"
},
"extracted": {
"values": {
"by": "dhouston",
"title": "My YC app: Dropbox - Throw away your USB drive",
"score": 104,
"type": "story"
},
"errors": []
}
},
"meta": {
"cost": "$0.0005",
"balance": "$3.0785",
"request_id": "req_eb27065c8b54e06e546e6329f69e100c"
}
}How it works
One Hacker News item — story, comment, poll, or job — by its numeric id. An id with no item returns no fields and 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. |