Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Unofficial Hacker News API
Branch: master

Hacker News (unofficial) API

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

NOTE: 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 or memcached.
  4. npm install
  5. node server.js
  6. Load localhost in your web browser.


HNapi uses nconf for configuration, which can be done via the config.json file, environment variables and command-line arguments.

  • port - (default: 80) 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
    • store - (memcached | redis, default: none) Specify the cache store
    • options - Options for specified cache store
      • servers - HOST:PORT for memcached server
      • url - redis://USERNAME:PASSWORD@HOST:PORT for redis server
      • debug - (default: false) Allows debugging (only for redis store)
  • papertrail - for logging with Papertrail
    • host
    • port
    • hostname (optional) - host name for the server
  • universal_analytics - for logging with Google Analytics' Universal Analytics' Measurement Protocol
    • tid - tracking ID


Licensed under the MIT License.

Other APIs

Something went wrong with that request. Please try again.