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.
stevekrouse avatar
stevekrouse
valTownBlogRSSHandler
HTTP
Forked from coofdy/streamThesaphistRSS
0
andybak avatar
andybak
countryOutlineSVG
HTTP
An interactive, runnable TypeScript val by andybak
1
taras avatar
taras
cors_proxy
HTTP
Forked from taras/free_open_router
1
tkneisly avatar
tkneisly
SupabaseAuthExample
HTTP
An interactive, runnable TypeScript val by tkneisly
0
jeffreyyoung avatar
jeffreyyoung
literaryIvorySlug
HTTP
Forked from jeffreyyoung/bot1
0
highants avatar
highants
httpPostExtractHTMLText
HTTP
// This endpoint accepts and returns data.
0
paul_lecam avatar
paul_lecam
EnkakuStatefulHTTPExample
HTTP
Example of an Enkaku server over HTTP. Client code Val Enkaku documentation
0
stevekrouse avatar
stevekrouse
basicAuthorization
Script
An interactive, runnable TypeScript val by stevekrouse
0
mykalattinybox avatar
mykalattinybox
aqi
Cron
Forked from stevekrouse/aqi
0
yieldray avatar
yieldray
decorator_router
Script
Decorator Router Fair simple decorator based router, with GET/POST and middleware support. demo live demo: https://yieldray-decorator_router_demo.web.val.run/ import { get, post, all, use, registered, handler, type Context } from "https://esm.town/v/yieldray/decorator_router"; import { parseBearerAuth, transformResponse } from "https://esm.sh/serve-router@1.1.0/utils"; interface User { id: number; name: string; } const users: User[] = [ { id: 0, name: "Alice" }, { id: 1, name: "Ray" }, ]; class _Server { /** * Decorator @get: Parses URLSearchParams into an object as the first parameter. */ @get("/users") getAllUsers() { return users; // Automatically wrapped in a Response.json } @get("/getUserByName") // GET /getUserByName?name=Alice getUserByName({ name }: Record<string, string>) { const user = users.find((u) => u.name === name); if (user) { return user; // Automatically wrapped as Response.json(user) } // Optionally, manually return a Response object return Response.json({ error: "not found" }, { status: 404 }); } @get("/user/:id") // GET /user/123 user(_: unknown, { params: { id } }: Context) { return users.find((u) => u.id === Number(id)); } /** * Decorator @post: Parses the request body into an object as the first parameter. */ @post("/user") // POST /user async createUser(user: User) { if (users.find((u) => u.id === user.id)) { return { error: "already exists!" }; } await users.push(user); // Assume insertion into a database return { ok: true, users }; } @post("/user/:id") // POST /user/123 async updateUser(user: User, { params: { id }, request }: Context) { const token = parseBearerAuth(request.headers.get("Authorization")!); // Additional logic here... } @all("/") home({ request }: { request: Request }) { return { registered, method: request.method, url: request.url, headers: Object.fromEntries(request.headers.entries()), }; } @use("/*") async corsMiddleware({ next, request }: Context) { const resp = await next(); return transformResponse(resp, { headers: { "Access-Control-Allow-Origin": request.headers.get("origin") || "*", }, }); } } // For Deno: Deno.serve(handler); // For val.town: export default handler;
0
AIWB avatar
AIWB
DualLangWebSpeechAPI
HTTP
@jsxImportSource https://esm.sh/react@18.2.0
0
prabhanshu avatar
prabhanshu
claudeForwarder
HTTP
// This val implements a function to call the Claude API using fetch.
0
suncin avatar
suncin
downloadMega
Script
An interactive, runnable TypeScript val by suncin
0
stwind avatar
stwind
WebGLTest
HTTP
Testing WebGL A minimal template for writing shaders.
1
arrudaricardo avatar
arrudaricardo
github_change_user_status
Script
An interactive, runnable TypeScript val by arrudaricardo
0
ajax avatar
ajax
resumeConfig
Script
Forked from iamseeley/resumeConfig
0