Back to APIs list

Hacker News API examples & templates

Use these vals as a playground to view and fork Hacker News API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
akkartik avatar
hnAuthors
@akkartik
Script
An interactive, runnable TypeScript val by akkartik
rodrigotello avatar
hnCommentToHTML
@rodrigotello
Script
Forked from stevekrouse/hnCommentToText
stevekrouse avatar
tanLadybug
@stevekrouse
HTTP (deprecated)
Forked from jahabeebs/safeMessageBoard
tfayyaz avatar
tahirsTil
@tfayyaz
HTTP (deprecated)
Forked from stevekrouse/linkInBioTemplate
tmcw avatar
big_story_visualization
@tmcw
Express
The Big Story This val, along with @tmcw.big_story , which requests from the New York Times API , and @tmcw.big_stories_ranks , which contains the data, generates a visualization of top stories on the NYTimes homepage. This is here just to ask the question – what happens to cover stories over time? Do they slowly drop down the page, or just get replaced by a fully new lede? So far it doesn't have quite enough data to answer that question. But also, it might be neat because it'll show which kinds of stories make the front page - is it climate, war, politics, or something else? 👉 The Big Story (visualization)
deepfates avatar
greenWren
@deepfates
HTTP (deprecated)
Forked from deepfates/HTMX_template
janpaul123 avatar
valle_tmp_3011947751662660376708881415586205
@janpaul123
HTTP (deprecated)
// Initialize sample stories and store them in blob storage
janpaul123 avatar
valle_tmp_701816702132716405607952805626981
@janpaul123
HTTP (deprecated)
// Initialize sample stories and store them in blob storage
kajgod avatar
njuskaloCrawl
@kajgod
Script
Njuškalo Crawler Crawler for the most popular Croatian eBay-like online store. Allows for several search strings & e-mails if anything new is listed. Also has a password-protected frontend where you can set keywords: https://www.val.town/v/kajgod.njuskaloIndex create a val with only: 'const njuskaloData = {};' fork: Frontend Backend create secret in your profile: njuskalo_password open express endpoint on njuskaloIndex & set cron for njuskaloCrawl to run every hour or 15 min.
jdan avatar
esmTown
@jdan
HTTP (deprecated)
Forked from jdan/blobImages
metart43 avatar
webhookHandler
@metart43
Script
An interactive, runnable TypeScript val by metart43
kylem avatar
starlightFaker
@kylem
HTTP
Forked from kylem/loremIpsumMarkdownGenerator
jamiedubs avatar
wikipediaToday
@jamiedubs
HTTP (deprecated)
fetch the contents of the Wikipedia "On this day in history" page. defaults to JSON output, but specify ?format=text or ?format=html for other outputs. e.g. https://jamiedubs-wikipediatoday.web.val.run/?format=json https://jamiedubs-wikipediatoday.web.val.run/?format=text https://jamiedubs-wikipediatoday.web.val.run/?format=html #wikipedia
vladimyr avatar
podnews
@vladimyr
Script
// import { fetch } from "https://esm.town/v/std/fetch?v=4";
akkartik avatar
hnContextLink
@akkartik
Script
An interactive, runnable TypeScript val by akkartik
janpaul123 avatar
valle_tmp_3373497323659926417371153829721253
@janpaul123
HTTP (deprecated)
// Retrieve stories data from blob storage on server start