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.
tmcw avatar
tmcw
short
Express (deprecated)
Short URLs A URL shortener in Val Town! This turns URLs into strings like https://tmcw-short.express.val.run/JK Which, well - it's not that short 🤣 but it's a start! It's pretty simple! In this case the storage is a private val because it contains some URLs. Part of the magic here is the venerable hashids module, which produces non-sequential string identifiers from an underlying serial numeric ID. So instead of huge UUIDs or fixed-length IDs like nanoid would generate, this generates short IDs, at least initially - like the example above, which is just "JK".
1
printerman avatar
printerman
encouragingChocolateMole
HTTP
Forked from printerman/valentine
1
dhvanil avatar
dhvanil
web_mNmUAMoXPj
HTTP
An interactive, runnable TypeScript val by dhvanil
0
rlimit avatar
rlimit
http
Script
* API Client for interfacing with the RateLimit API. Uses free tier rlimit.com credentials.
0
pomdtr avatar
pomdtr
ejm_test
Script
An interactive, runnable TypeScript val by pomdtr
0
yawnxyz avatar
yawnxyz
dobby
Script
Simple wrapper class around valtown's sqlite https://www.val.town/v/yawnxyz/dobby // Example usage: const dobby = new Dobby("myDatabase", [ { name: "id", type: "INTEGER", primaryKey: true }, { name: "name", type: "TEXT", notNull: true }, { name: "age", type: "INTEGER" }, { name: "balance", type: "REAL" }, ]); await dobby.createDatabase(); // Insert some sample data await dobby.insert({ id: 1, name: "John Doe", age: 30, balance: 1000.50 }); await dobby.insert({ id: 2, name: "Jane Smith", age: 25, balance: 2000.75 }); await dobby.insert({ id: 3, name: "Bob Johnson", age: 40, balance: 1500.25 }); // Filter examples const results1 = await dobby.filter({ age: { gt: 25 } }); console.log("Users older than 25:", results1); const results2 = await dobby.filter({ name: { like: '%John%' } }); console.log("Users with 'John' in their name:", results2); const results3 = await dobby.filter({ balance: { between: [1000, 2000] } }); console.log("Users with balance between 1000 and 2000:", results3); const results4 = await dobby.filter({ age: { in: [25, 30, 35] } }); console.log("Users aged 25, 30, or 35:", results4); const results5 = await dobby.filter({ name: { ne: 'John Doe' } }, { limit: 2 }); console.log("Up to 2 users not named John Doe:", results5); // Search examples const searchResults1 = await dobby.search("name", "John"); console.log("Users with 'John' in their name:", searchResults1); const searchResults2 = await dobby.search("name", "son", { limit: 1 }); console.log("First user with 'son' in their name:", searchResults2); // You can search in any text column const searchResults3 = await dobby.search("age", "3"); console.log("Users with '3' in their age:", searchResults3); // Example of using the new dropDatabase function await dropDatabase("myDatabase");
0
devdoshi avatar
devdoshi
subscribeToPush
Script
An interactive, runnable TypeScript val by devdoshi
0
baiyapeng avatar
baiyapeng
pushMsg
Script
An interactive, runnable TypeScript val by baiyapeng
0
tmcw avatar
tmcw
htmlExample
HTTP
Returning HTML from the Val Town Web API This just lets you use the standard Response object with our Web API to return an HTML response from this Val.
0
henrik avatar
henrik
expressHTMLExample2
Script
Forked from stevekrouse/expressHTMLExample2
0
ricvelaz avatar
ricvelaz
seemlyChocolateEarwig
HTTP
Forked from ricvelaz/Roni
0
reosablo avatar
reosablo
sampleVanIsland
Script
simple App component made with VanJS This script is not for execution but for import for SSR + hydration. See https://www.val.town/v/reosablo/sampleVanSSR
0
janpaul123 avatar
janpaul123
valle_tmp_89536935439269698168594418080808
HTTP
// This val serves an HTML page styled with CSS to display "Hello World" in a visually appealing way.
0
stevekrouse avatar
stevekrouse
gpt3Unsafe
Script
An interactive, runnable TypeScript val by stevekrouse
0
stevekrouse avatar
stevekrouse
hiddenAPI
RPC (deprecated)
An interactive, runnable TypeScript val by stevekrouse
0
dinavinter avatar
dinavinter
with_yjs
Script
An interactive, runnable TypeScript val by dinavinter
0