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.
iamseeley avatar
iamseeley
Server2
HTTP
🚧 hono + htmx web app 🚧 idea: linktree-esque profile page w/ widgets powered by vals setup: fork the val and uncomment the /signup and /login routes create a jwt secret token environment variable go to the db setup val and run it to create the tables (as the site is right now, you can only add/edit users and add/edit/delete user links) to do: [ ] create some val town apis for the profile widgets (add vals people have already made) [ ] add profile image (will probably point to val town profile pic) [ ] add delete profile handler [ ] finish public profile page [ ] 🎨🎨🎨🎨🎨
2
roysarajit143 avatar
roysarajit143
photoEditingAIApp
HTTP
@jsxImportSource https://esm.sh/react@18.2.0
0
alp avatar
alp
proxyFetch2
Script
An interactive, runnable TypeScript val by alp
0
patrickroumanoff avatar
patrickroumanoff
status401
HTTP
An interactive, runnable TypeScript val by patrickroumanoff
0
stevekrouse avatar
stevekrouse
searchParams
Script
An interactive, runnable TypeScript val by stevekrouse
0
vladimyr avatar
vladimyr
keyvhqLow
Script
// SPDX-License-Identifier: 0BSD
0
andreterron avatar
andreterron
renderFormAndSaveData
HTTP
Render form and save data This val provides a web-based interface for collecting email addresses. It features a dual-functionality approach: when accessed via a web browser using a GET request, it serves an HTML form where users can submit their email address. If the script receives a POST request, it implies that the form has been submitted, and it proceeds to handle the incoming data. Fork this val to customize it and use it on your account.
4
tmcw avatar
tmcw
jsYAMLExample
Script
js-yaml YAML is a popular format for data which is an alternative to JSON . In contrast to JSON, YAML can look more user-friendly: you can write text without worrying about quoting strings You can write comments in YAML But, on the other side, it's more possible to write YAML that is parsed in an unexpected way. JSON is more explicit and predictable. js-yaml is the most popular YAML parser for JavaScript.
0
charmaine avatar
charmaine
townieIllustratorPrompt
Script
Add this to Townie's System prompt by going into Townie's Settings — First ask a user what app they would like you to illustrate. Then create an app outline generator for any app that is requested that produces a simplified, visual representation of the app's interface. Core Functionality - Accept an app name as input (e.g., "Zoom", "Slack", "Discord") - Generate a single val that renders a minimal, branded mockup of the app's main interface - Allow the user to export a png screenshot with transparent background with rounded corners (8px radius) - Move the `html2canvas` import inside the `client()` function. - Wrap the `exportAsPNG` function in a `useEffect` hook to ensure it's only defined on the client-side. - Use dynamic import for `html2canvas` inside the `exportAsPNG` function. - Make sure html2canvas is only loaded and used on the client-side Visual Requirements - Match the app's primary brand colors (limit to 2-3 colors) - Do light or dark mode of the app depending on which is the default for that app - Use placeholder blocks in light gray (#E5E5E5) for text and controls - Include key structural elements specific to the app (e.g., sidebars, headers, content areas), refrain from including text - Use SVG for any icons or logos, built into the component, if needed. - Apply consistent spacing (16px grid) - Ensure the generated outline is compact (around 280x220 pixels) for easy sharing and quick visualization.
1
rektdeckard avatar
rektdeckard
FontPack
HTTP
An interactive, runnable TypeScript val by rektdeckard
0
iamseeley avatar
iamseeley
pyodideSetup
Script
An interactive, runnable TypeScript val by iamseeley
0
stevekrouse avatar
stevekrouse
lastlogin
Script
Forked from pomdtr/lastlogin
5
tmcw avatar
tmcw
zodExample
Script
Zod Zod works great out-of-the-box with Val Town: just import it as npm:zod and parse something! Here's an example below. Tips Right now it's not possible to create a script val that immediately returns a Zod parser because its parsers can't be serialized. It's best to either expose a method that returns a parser, or to create and use the parser in the same val.
0
saolsen avatar
saolsen
gameplay_games
Script
gameplay_games This is a val.town mirror of gameplay/games . Click the link to see docs.
0
vladimyr avatar
vladimyr
fetchNewestVals
Script
// SPDX-License-Identifier: 0BSD
0
jxnblk avatar
jxnblk
middleware
Script
Minimal middleware for val town Demo Usage import { app, Middleware } from "https://esm.town/v/jxnblk/middleware"; const robots: Middleware = async (req, res, ctx) => { const url = new URL(req.url); if (url.pathname === "/robots.txt") { return new Response("User-agent: *\nAllow: /"); } return null; } const getData: Middleware = async (req, res, ctx) => { // do async work here... // add data to context ctx.hello = `hello ${new Date().toLocaleDateString()}`; // set headers res.headers.set("X-Hello", ctx.hello); // return null to pass to the next middleware return null; } const renderHTML: Middleware = async (req, res, ctx) => { const html = ` <h1>${ctx.hello}</h1> ` return new Response(html, { headers: { "Content-Type": "text/html", }, }); } export default app([ robots, getData, renderHTML, ])
0