HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
minimaxir
get-all-hacker-news-submissions-comments
Python2015–2018
minimaxir / get-all-hacker-news-submissions-comments

get-all-hacker-news-submissions-comments

Simple Python scripts to download all Hacker News submissions and comments and store them in a PostgreSQL database.

2Distinct people
13Mentions
0Explicit recommenders
127GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Simple Python scripts to download all Hacker News submissions and comments and store them in a PostgreSQL database.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year13 dated mentions

Observed mentions: 2015-05-11 14:59:02 UTC to 2018-02-19 05:26:05 UTC.

024682015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 8 mentions; 2 submissions, 6 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC826
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC202
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC202
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101

What Hacker News says

13 sources
Not quite what you asked: https://github.com/minimaxir/get-all-hacker-news-submissions... source: https://news.ycombinator.com/item?id=14337275 search related: https://hn.algolia.com/?query=bigquery-public-data:hacker_ne... found: https://news.ycombinator.com/item?id=14580698 (New HN data dump available with over 14.5m entries) 7.3GB through 2017Jun) https://news.ycombinator.com/item?id=10440502 (Tell HN: Full Hacker News dataset now available on BigQuery)
In Ask HN: Is there a script to download past 3 months of HN or top n posts?
Direct URL to project details: https://devpost.com/software/tagger-news A few comments: 1. To other commenters, as with the HN Vue demo a week ago (https://news.ycombinator.com/item?id=14284877), the project is a technical proof-of-concept; the aesthetics aren't the primary focus. 2. The Algolia API is better for scraping because it allows for bulk requests, unlike the official API (my old 2014 script still works I think: https://github.com/minimaxir/get-all-hacker-news-submissions...) 3) How much time did it take to manually label the training/test set before training the RF classifier? Even with topic modeling for extrapolating tags, accurate labeling for 20,000 submissions is a task.
In Tagger News takes a subset of HN articles, analyzes using ML, and applies tags
A couple years ago, I did my own analysis of all Hacker News submissions (http://minimaxir.com/2014/02/hacking-hacker-news/) and also wrote a script around that time to get all data (https://github.com/minimaxir/get-all-hacker-news-submissions... , see also a modern dataset on Kaggle derived from it: https://www.kaggle.com/hacker-news/hacker-news-posts). I only looked at the # of points as a metric for quality, so front v. back with this approach is interesting. Given the good work in this post, I may take another look at the data myself. This is a case where the sample size used may be problematic. "425 fronts against 570 corresponding backs" (n = 995), in the grand scheme of Hacker News, is not a lot, even if statistical analysis permits it (example: the by-hour Chi-Sq test, which barely hits the 5-per-cell assumption). Given the method
Read the rest
of collection by scraping the front page directly, this is understandable, though. However, that presents a problem. the front-page algorithm has changed in recent months and I myself have had difficulty predicting what makes the front page and what doesn't (and what ends up making the front page hours after being submitted for no reason). With relatively new features like the second-chance pool and explicit dupe marking, there is new quality control of the front page thanks to dang/sctb. That is another issue of looking at a small subset of HN data; it does not reflect the site as a whole, although looking at more-recent data might be more beneficial for optimizing one's own posts.
In Data Mining Hacker News: Front vs. Back
> At 4 GB, I'd just as soon query this locally, but this looks like a fun exercise. This requires scraping all the Hacker News data manually, for which I have a tool to do so (https://github.com/minimaxir/get-all-hacker-news-submissions...) which I mentioned in the post you linked, but it still requires a significant amount of time to get/process the data, hence why the BigQuery dataset has a significant advantage.
In Top Books on Amazon Based on Links in Hacker News Comments
minimaxir·Oct 23, 2015Submission

Tell HN: Full Hacker News dataset now available on BigQuery

https://bigquery.cloud.google.com/table/fh-bigquery:hackernews.comments The dataset is up-to-date for October 2015 and uses the official HN API as a data source. (Unfortuntely, this includes the HTML formatting in the comments) Dataset is about 4GB total; since BigQuery allows for 1000GB processing for free each month, it is effectively no cost to analyze. Felipe Hoffa (who uploaded the dataset) has links to the dataset along with some sample Python code for analysis: https://github.com/fhoffa/notebooks/blob/master/analyzing%20hacker%20news.ipynb I have a few scripts for downloading all the data manually (https://github.com/minimaxir/get-all-hacker-news-submissions-comments ), but the BigQuery table may be more pragmatic. I can do some more sample queries if requested. (See my BigQuery tutorial for Reddit data: http://minimaxir.com/2015/1
Read the rest
0/reddit-bigquery/ )
238 points · Open discussion
Relevant: if you're looking for a way to scrape all Hacker News submissions and comments, I have a GitHub repository containing Python scripts showing how to do just that: https://github.com/minimaxir/get-all-hacker-news-submissions... With respect to the article, I've done data analysis on Hacker News myself (e.g. http://minimaxir.com/2014/10/hn-comments-about-comments/ ) and I'm a little skeptical. I was not a fan of using NTLK to classify positive/negative because the models used for training sentiment are based on reviews, not internet site comments, and when I had used NTLK, the results were skewed significantly. I used an alternate model mentioned in the linked post which IMO worked better. The examples used in the article seem more like correlation-implying-causation and cherry-picking. There are many, many counterexamples of start
Read the rest
ups people loved on HN which died a painful death.
In Hacker News as a case study to test the wisdom of the crowd theory
> the difficulty is that investigating a complex dataset is by definition too complex to really fit into a blog post It's not complex, but it requires answering scaleability questions. How do you fit the data into memory? How do you even get big data? I managed to analyze 5.6M Hacker News comments (http://minimaxir.com/2014/10/hn-comments-about-comments/ ) by writing a scraper which dumps everything into a PostgreSQL database (https://github.com/minimaxir/get-all-hacker-news-submissions... ) because it's way too big to fit in memory. Likewise, to visualize the recent NYC taxi data, (http://minimaxir.com/2015/08/nyc-map/ ), I just used BigQuery and saved myself a load of time downloading the data and setting things up. But in many cases, data is not easily accessible, and not cheap to store and process. I want to switch to an actual big da
Read the rest
ta workflow with Spark, but running the numbers with EC2 storage and processing, it won't be cheap and I may have to set up a Patreon to subsidize things.
In Statistics for Hackers

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.