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.
pomdtr avatar
run
@pomdtr
HTTP (deprecated)
Augmented run api This val is a wrapper on top of the val.town run api, improving it with additional features: basic auth content-type header in response based on url file extension Usage Custom Content-Type The content-type will be inferred from the filename using the mime-types library. If you use a .html extension, the response will be interpreted as text/html ~ $ curl -v 'https://pomdtr-run.web.val.run/pomdtr/helloWorld.html' HTTP/1.1 200 OK ... Content-Type: text/html; charset=utf-8 ... Hello, World! If you switch the extension to .txt , the content-type header switch to text/raw . ~ $ curl -v 'https://pomdtr-run.web.val.run/pomdtr/helloWorld.txt' HTTP/1.1 200 OK ... Content-Type: text/plain; charset=utf-8 ... Hello, World! Passing arguments The request is proxyed to the run api, so you can pass args to your vals via query params or body. See the run api docs for more details. ~ $ curl -X POST -d '{"args": ["pomdtr"]}' 'https://pomdtr-run.web.val.run/pomdtr/helloWorld.html' ... < content-type: text/html; charset=utf-8 ... Hello, pomdtr! Basic Authentication Just add your val town token as the username: curl 'https://<val-token>@pomdtr-run.web.val.run/pomdtr/privateVal.txt'
nbbaier avatar
TanaAPIHelper
@nbbaier
Script
An interactive, runnable TypeScript val by nbbaier
dthyresson avatar
playRandomSong
@dthyresson
HTTP
Play a Random Song ... from a set of Spotify tracks that have been played by me or others using the playMeASong val. Queries a random record of a tracks table and redirects to it's Spotify url. Usage // random const track = await getRandomTrack(); // random for artist const track = await getRandomTrack("Pixies");
neverstew avatar
okJson
@neverstew
Script
@stevekrouse - are you OK?
stevekrouse avatar
example_gsmaverick_weather
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
stevekrouse avatar
expressTestSimple
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
reosablo avatar
sampleVanSSR
@reosablo
HTTP (deprecated)
simple SSR + hydration example with VanJS
vlad avatar
serverlessMatrixEchoBot
@vlad
Express
A example Serverless Bot for Matrix chat. See https://vlad.roam.garden/How-to-create-a-serverless-Matrix-Chat-bot for a more detailed write-up on how to set one up! To test this bot: invite serverless-echo@matrix.org to your unencrypted room Send a message starting with !echo and the bot will repeat content after. Use https://matrix-serverless.netlify.app/ to configure Matrix to call the endpoint on newly received messages
stevekrouse avatar
today
@stevekrouse
Script
Today's Date Returns today's date without timestamp. Usage @stevekrouse.today() // "10/07/2023"
tmcw avatar
ittyRouterExample
@tmcw
HTTP (deprecated)
itty-router This is an example of using the Val Town Web API to integrate with itty-router . Server examples Hono Peko Itty Router Nhttp
parkerdavis avatar
docFeedbackForm
@parkerdavis
HTTP (deprecated)
Forked from stevekrouse/docFeedbackForm
jrmann100 avatar
pushSendNotification_negrel
@jrmann100
Script
Forked from jrmann100/pushSendNotification
nbbaier avatar
mirroredSearchAPI
@nbbaier
HTTP (deprecated)
Expanded search endpoint This is a mirrored version of the Val Town API /search/vals endpoint, meant mostly for use with pomdtr's vscode extension . It allows for more sophisticated filtering of the results of a search.
stevekrouse avatar
googleOauthDebug
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
janpaul123 avatar
valle_tmp_24901011813828427349436434809345
@janpaul123
HTTP (deprecated)
// This val responds with an HTML form styled with fun CSS to input the user's name and greets them upon form submission
alexandercato avatar
addMessageToFrontOfTanakiQueue
@alexandercato
Script
An interactive, runnable TypeScript val by alexandercato