Playing around with the Hacker News API and noticed that it’s returning hundreds of story IDs when queried. It’s not ideal and can take longer to resolve. Since the Hacker News API is handled by Firebase we can use the
limitToLast query params to only return a set number of the first or last stories.
Here’s what the top stories query would look like to return the first 10:
Which would return something like:
[ 23546706, 23543131, 23543277, 23543043, 23526516, 23546206, 23540704, 23547367, 23538015, 23537261 ]
Link to more info: Firebase