TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

‘Reverse Engineering’ Hacker News into an API

52 点作者 rashadphil将近 3 年前

8 条评论

exikyut将近 3 年前
The main issue with all apps like this is not the reverse-engineering, which is relatively straightforward, but the fact that HN sits behind Cloudflare, with the WAF and ratelimiting enabled.<p>It&#x27;s not possible to achieve capability-parity just *reading* HN as the API does not return comment karma, which is used to sort the view. (I think this is the subtler half of why HN reader sites never catch on - the interesting comments are never at the top, so the presented content is very noticeably that much more boring.)<p>So a while back I tried building a simple scraper component (an internal API, I guess) that would use Firebase for realtime updates, and strategically poll the site (say one request every 3-5 seconds) to get the current sort order. I never got to the Firebase part because I crashed into Cloudflare while fiddling around tuning the ratelimiting.<p>So yeah. You need full Chrome (to satisfy whatever Cloudflare&#x27;s WAF throws at you) and a captcha-solving subscription (because the WAF <i>will</i> get the flyswat out when it sees your datacenter IP) to be able to do this properly - <i>especially</i> if you want to APIify this sort of thing.
评论 #31881471 未加载
评论 #31882435 未加载
searchableguy将近 3 年前
I tried creating a GraphQL API[0] for HN for both read and write operations so I could eventually use it to write a HN client app but I hit a wall due to HN scraping policy. It limits you to fetching a page once every 30 seconds[1]. Yes, I confirmed with dang that I would need to adhere to this.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;searchableguy&#x2F;hackernews_graphql" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;searchableguy&#x2F;hackernews_graphql</a><p>[0] <a href="https:&#x2F;&#x2F;hngraphql.fly.dev&#x2F;graphql" rel="nofollow">https:&#x2F;&#x2F;hngraphql.fly.dev&#x2F;graphql</a><p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;</a>
CharlesW将近 3 年前
Related: <a href="https:&#x2F;&#x2F;swizec.com&#x2F;blog&#x2F;how-i-reverseengineered-hacker-news&#x2F;" rel="nofollow">https:&#x2F;&#x2F;swizec.com&#x2F;blog&#x2F;how-i-reverseengineered-hacker-news&#x2F;</a>
stefanvdw1将近 3 年前
Replicating the features that require being logged in such as upvoting and commenting is actually not trivial.<p>I recently built a Hacker News client [0] on top of the official API and using the method described in the article to login users is very inconsistent. I kept running into Captcha issues and even when that didn’t happen, sometimes a login request would simply not return the expected token.<p>Unless the official API starts offering user login, this will remain difficult.<p>0. <a href="https:&#x2F;&#x2F;modernorange.io" rel="nofollow">https:&#x2F;&#x2F;modernorange.io</a>
splittingTimes将近 3 年前
For years, i just want to be able to easily search through my &quot;favorite submissions&quot; which I use as a kind of bookmark. Guess we will never see that. Not on the website nor in an app.
评论 #31893662 未加载
评论 #31882631 未加载
bdcravens将近 3 年前
(2018)
评论 #31881455 未加载
captn3m0将近 3 年前
Didn’t HN get an official API a long time ago? Or was that read-only?
评论 #31881998 未加载
dr_pardee将近 3 年前
Search hackd in iOS app store
评论 #31881072 未加载
评论 #31881059 未加载