Skip to content
Unofficial Hacker News API
Branch: master
Clone or download
Latest commit b738d6d Feb 27, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
package.json Upgrade dependencies Feb 27, 2019
server.js Add `s-maxage` header Dec 15, 2018

Hacker News (unofficial) API

Yet another unofficial API for Hacker News. Currently being used by my other project. Feel free to fork and contribute.

☕️ Buy me a coffee ☕ (server, domain & maintenance)

Donate Buy me a coffee


If you are planning to scrape a huge amount of posts or (historical) data from HN, please don't use this API. Use the official Hacker News API or HN Search API instead.

Quick Start

  1. git clone this repo.
  2. cd to repo folder.
  3. Optionally download, install and start redis.
  4. yarn
  5. yarn start
  6. Load localhost:1337 in your web browser.



HNapi uses dotenv for configuration.

  • PORT - (default: 1337) Server port
  • CACHE_EXP - (default: 600) Cache expiry in seconds
  • LOG_REFERER - (default: false) Logs referers
  • LOG_USERAGENT - (default: false) Logs user-agent strings
  • CACHE_MEMORY - (default: true) Use in-memory caching
  • CACHE_STORE - (redis, default: none) Specify the cache store
  • CACHE_SERVER - HOST:PORT for Redis server


Licensed under the MIT License.

Other APIs

You can’t perform that action at this time.