

Ask HN/PG: Is there an API for hackernews? - chunky1994

If so, where can I find it? If not, how did everyone who got data about HN (such as in posts about the best time to post etc.) get their data? Did you just crawl HN?
======
neilco
There's an API from the search engine provider, Algolia:

[https://hn.algolia.com/api](https://hn.algolia.com/api)

------
minimaxir
The 2010 era blog posts on best time to post used scraping, but the Algolia
API just released is robust enough for HN data analysis. (proof:
[http://minimaxir.com/2014/02/hacking-hacker-
news/](http://minimaxir.com/2014/02/hacking-hacker-news/) )

[https://hn.algolia.com/api](https://hn.algolia.com/api)

------
jaredsohn
To download all stories:

[https://github.com/minimaxir/hacker-news-download-all-
storie...](https://github.com/minimaxir/hacker-news-download-all-stories)

To download all comments:

[https://github.com/jaredsohn/hacker-news-download-all-
commen...](https://github.com/jaredsohn/hacker-news-download-all-comments)

To download saved stories (not available via API; haven't personally tried it
though):

[https://github.com/dougk7/hackernews-
stories](https://github.com/dougk7/hackernews-stories)

------
mschuster91
Yeah, HTML scraping with PHP's DOM functions... I'm cleaning it up atm and
will release it on github wehen done.

HN is, from a technological POV, stuck in the Middle Ages when compared to the
startups that YCombinator backs.

~~~
minimaxir
The Algolia API is far superior than any scraping API (incidentally, it's also
a YC startup)

------
shamsulbuddy
try [http://hnapp.com/](http://hnapp.com/) .. get the json response

