HACKER Q&A
📣 liorkaslasi

How do I connect to Hacker News API?


I'm a student and I would like to query HN data, I tried to connect firebase API without any success. I would be happy to some advice. Thanks in advance


  👤 krapp Accepted Answer ✓
Examples:

an item - https://hacker-news.firebaseio.com/v0/item/8863.json

a page (new,best,ask,show,jobs) - https://hacker-news.firebaseio.com/v0/topstories.json ..(this returns an array of ids, you'll have to iterate that and make separate requests for each entry.) Also these are limited to 500 items.

a user - https://hacker-news.firebaseio.com/v0/user/jl.json

max id - https://hacker-news.firebaseio.com/v0/maxitem.json (you can use this to iterate all items or update all items since a last cache)

updates - https://hacker-news.firebaseio.com/v0/updates.json


👤 BoHerfIIIJrEsq
Hmm, it seems to be working. There are some nice examples on https://github.com/HackerNews/API