cheeaun / Node Hnapi
Unofficial Hacker News API
Stars: ✭ 284
Programming Languages
javascript
184084 projects - #8 most used programming language
Hacker News (unofficial) API
Yet another unofficial API for Hacker News. Currently being used by my other project. Feel free to fork and contribute.
- API (Cloudflare CDN, faster response time): http://api.hackerwebapp.com/
- API Documentation: https://github.com/cheeaun/node-hnapi/wiki/API-Documentation
☕️ Buy me a coffee ☕ (server, domain & maintenance)
🚧 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
-
git clone
this repo. -
cd
to repo folder. - Optionally download, install and start redis.
npm i
npm start
- Load
localhost:1337
in your web browser.
Example
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
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].