Hacker News Data Scraper
Try for free
3 days trial then $10.00/month - No credit card required now
View all Actors
Hacker News Data Scraper
epctex/hackernews-scraper
Try for free
3 days trial then $10.00/month - No credit card required now
Extract Y Combinator's Hacker News based on any search criteria. Crawl the front page, Show HN, Ask HN, news, job listings, and historical data. Get links, titles, comments, ratings, and more!
The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn more
1# Set API token
2API_TOKEN=<YOUR_API_TOKEN>
3
4# Prepare Actor input
5cat > input.json <<'EOF'
6{
7 "startUrls": [
8 {
9 "url": "https://news.ycombinator.com/front"
10 },
11 {
12 "url": "https://news.ycombinator.com/show"
13 },
14 {
15 "url": "https://news.ycombinator.com/jobs"
16 },
17 {
18 "url": "https://news.ycombinator.com"
19 },
20 {
21 "url": "https://news.ycombinator.com/item?id=26566373"
22 }
23 ],
24 "maxItems": 50,
25 "endPage": 1,
26 "extendOutputFunction": "($) => { return {} }",
27 "proxy": {
28 "useApifyProxy": true
29 }
30}
31EOF
32
33# Run the Actor using an HTTP API
34# See the full API reference at https://docs.apify.com/api/v2
35curl "https://api.apify.com/v2/acts/epctex~hackernews-scraper/runs?token=$API_TOKEN" \
36 -X POST \
37 -d @input.json \
38 -H 'Content-Type: application/json'