node-hnapi

Unofficial Hacker News API

  • Owner: cheeaun/node-hnapi
  • Platform:
  • License::
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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


? PLEASE READ THIS ?

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.

Example

http://api.hackerwebapp.com/news?page=2

Configuration

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

License

Licensed under the MIT License.

Other APIs

Main metrics

Overview
Name With Ownercheeaun/node-hnapi
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
Platform
License:
所有者活动
Created At2011-10-31 01:17:15
Pushed At2025-02-20 15:14:14
Last Commit At2025-02-20 23:13:42
Release Count0
用户参与
Stargazers Count342
Watchers Count5
Fork Count42
Commits Count384
Has Issues Enabled
Issues Count18
Issue Open Count3
Pull Requests Count11
Pull Requests Open Count13
Pull Requests Close Count6
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private