Back to APIs list

US Congress Stock Trading API examples & templates

Use these vals as a playground to view and fork US Congress Stock Trading API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
karfau avatar
isRequest
@karfau
Script
A type guard for vals that expect a WebApi Request as the first parameter. Since a val can be invoked by run, web, express or even email, the correct type for a web endpoint should be req?: Request | unknown . By using this type guard and handling the false case, all later code can safely access the request: export const myVal = (req?: Request | unknown) => { if (!@karfau.isRequest(req)) { return `This val has to be used with the web endpoint, see ${@neverstew.thisValUrl()}`; } if (req.method === 'GET') { // ... } }
stevekrouse avatar
untitled_blackBoa
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
fdterr avatar
untitled8638060
@fdterr
Script
An interactive, runnable TypeScript val by fdterr
stevekrouse avatar
untitled_blushMoth
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
willthereader avatar
untitled_copperSpoonbill
@willthereader
Cron
Forked from stevekrouse/pollRSSFeeds2
stevekrouse avatar
untitled_emeraldPorcupine
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
arbesman avatar
untitled1382609
@arbesman
Script
An interactive, runnable TypeScript val by arbesman
stevekrouse avatar
untitled_blackCrayfish
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
snm avatar
untitled4965473
@snm
Script
An interactive, runnable TypeScript val by snm
stevekrouse avatar
untitled_mutate_test_state
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
ingenieroariel avatar
untitled_limeHornet
@ingenieroariel
Script
// investigate how to load duckdb with spatial extensions in this context in order to load buildings from s3.
sarahmeyohas avatar
untitled8552959
@sarahmeyohas
Script
An interactive, runnable TypeScript val by sarahmeyohas
stevekrouse avatar
untitled_amaranthOtter
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
stevekrouse avatar
untitled_DGAyQqyx
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
rcurtiss avatar
untitled_moccasinWildebeest
@rcurtiss
HTTP (deprecated)
@jsxImportSource https://esm.sh/preact
stevekrouse avatar
untitled_qAbtMd3a
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse