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.
janpaul123 avatar
janpaul123
valle_tmp_95010852208558675148806336933602
HTTP
// This val serves an HTML page with an input field to enter a name. Upon form submission, it greets the user with the entered name in a pop style.
0
stevekrouse avatar
stevekrouse
parsePostBodyExample
HTTP
An interactive, runnable TypeScript val by stevekrouse
0
stevekrouse avatar
stevekrouse
hello_world
HTTP
An interactive, runnable TypeScript val by stevekrouse
0
agmm avatar
agmm
emailAPI
HTTP
// https://username-valname.web.val.run?k=myKey&s=mySubject&m=myMessage
0
spurushottam13 avatar
spurushottam13
myApi
Script
An interactive, runnable TypeScript val by spurushottam13
0
stevekrouse avatar
stevekrouse
testExError
Script
An interactive, runnable TypeScript val by stevekrouse
0
nico avatar
nico
whatIsMyIp
Express (deprecated)
Forked from devdoshi/whatIsMyIp
0
rozek avatar
rozek
Authorization_from_EnvVar_Test
HTTP
Here are some tests for val Authorization_from_EnvVar Test Cases Positive Test Cases Valid token with defined environment variable EnvVarName: "VALID_TOKEN" Environment variable value: "secret123" Authorization header: "Bearer secret123" Mode: "forbid-if-not-defined" Expected result: true Valid token with allow-if-not-defined mode EnvVarName: "VALID_TOKEN" Environment variable value: "secret123" Authorization header: "Bearer secret123" Mode: "allow-if-not-defined" Expected result: true Valid token with missing mode (default behavior) EnvVarName: "VALID_TOKEN" Environment variable value: "secret123" Authorization header: "Bearer secret123" Mode: undefined Expected result: true Negative Test Cases Invalid token EnvVarName: "VALID_TOKEN" Environment variable value: "secret123" Authorization header: "Bearer wrongtoken" Mode: "forbid-if-not-defined" Expected result: false No Authorization header EnvVarName: "VALID_TOKEN" Environment variable value: "secret123" Authorization header: undefined Mode: "forbid-if-not-defined" Expected result: false Environment variable not defined, forbid mode EnvVarName: "UNDEFINED_TOKEN" Environment variable value: undefined Authorization header: "Bearer anytoken" Mode: "forbid-if-not-defined" Expected result: false Environment variable not defined, allow mode EnvVarName: "UNDEFINED_TOKEN" Environment variable value: undefined Authorization header: "Bearer anytoken" Mode: "allow-if-not-defined" Expected result: true Error Cases Invalid environment variable name EnvVarName: "1INVALID" Environment variable value: "secret123" Authorization header: "Bearer secret123" Mode: "forbid-if-not-defined" Expected result: Error thrown Invalid Mode EnvVarName: "VALID_TOKEN" Environment variable value: "secret123" Authorization header: "Bearer secret123" Mode: "invalid-mode" Expected result: Error thrown Edge Cases Empty string as token EnvVarName: "EMPTY_TOKEN" Environment variable value: "" Authorization header: "Bearer " Mode: "forbid-if-not-defined" Expected result: true Case-sensitive token comparison EnvVarName: "CASE_TOKEN" Environment variable value: "Secret123" Authorization header: "Bearer secret123" Mode: "forbid-if-not-defined" Expected result: false Non-Bearer authorization type EnvVarName: "VALID_TOKEN" Environment variable value: "secret123" Authorization header: "Basic secret123" Mode: "forbid-if-not-defined" Expected result: false
0
seniorbrusko avatar
seniorbrusko
myApi
Script
An interactive, runnable TypeScript val by seniorbrusko
0
stevekrouse avatar
stevekrouse
localtime
HTTP
An interactive, runnable TypeScript val by stevekrouse
0
dotim avatar
dotim
checkTomorrowTempoEdf
Cron
Ce script permet de vérifier le statut du jour Tempo de demain (Bleu, Blanc ou Rouge) en utilisant l'API publique Couleur Tempo. S'il détecte un jour Rouge ou blanc, il envoie une notification pour avertir l'utilisateur. En cas d'erreur lors de la récupération des données, une notification d'erreur est également envoyée.
0
rozek avatar
rozek
UserSpecificResource_Test
HTTP
This val contains a few tests for the UserSpecificResource val
0
mojombo avatar
mojombo
umbrellaReminder
Cron
Forked from stevekrouse/umbrellaReminder
0
janpaul123 avatar
janpaul123
valle_tmp_055129233547254859908847559300911
HTTP
// This val responds with an HTML form styled with CSS to input the user's name and greet them upon form submission
0
nbbaier avatar
nbbaier
readmeGPT
Script
Forked from nbbaier/sqliteWriter
3
rozek avatar
rozek
HTTP_StatusCode
HTTP
An interactive, runnable TypeScript val by rozek
0