HN Favs API

A lightweight API to fetch and cache Hacker News favorites (stories or comments) for any user.


Features


Endpoints

Base url: https://hn-favs.byt3h3ad.workers.dev

1. Fetch User's Favorites

Example:

curl https://hn-favs.byt3h3ad.workers.dev/byt3h3ad/stories

2. Delete Cached Response

GET /:username/:type/delete-cache

Example:

curl https://hn-favs.byt3h3ad.workers.dev/byt3h3ad/stories/delete-cache

Response Format

Stories

[
  {
	"id": 42214331,
	"title": "What made Dostoevsky's work immortalwyounas.com",
	"url": "https://thoughts.wyounas.com/p/what-made-dostoevsky-immortal",
	"hnUrl": "https://news.ycombinator.com/item?id=42214331",
	"type": "story"
},
]

Comments

[
  {
	"id": 22446090,
	"url": "https://news.ycombinator.com/item?id=22446090",
	"user": "bori5",
	"type": "comment"
},
]