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_24901011813828427349436434809345
HTTP
// This val responds with an HTML form styled with fun CSS to input the user's name and greets them upon form submission
0
omaismoe avatar
omaismoe
isMyWebsiteDown
Script
Forked from andreterron/isMyWebsiteDown
0
alexandercato avatar
alexandercato
addMessageToFrontOfTanakiQueue
Script
An interactive, runnable TypeScript val by alexandercato
0
siygle avatar
siygle
resumeHandler
HTTP
Forked from iamseeley/resumeHandler
0
yawnxyz avatar
yawnxyz
stringInferExample
Script
example of inferring params from a prompt: https://x.com/yawnxyz/status/1812922642510586039 putting results in does wonders use an "extraction guide" to direct results
0
willthereader avatar
willthereader
versionLoggger
Script
This helper function logs the version number of the val. import { logUrlVersion } from "https://esm.town/v/stevekrouse/versionLoggger"; logUrlVersion(import.meta.url); Or if you want a one liner with no imports: console.log("Version: " + import.meta.url.match(/[?&]v=([^&]*)/)?.at(1));
1
stevekrouse avatar
stevekrouse
gemini2FlashExample
Script
An interactive, runnable TypeScript val by stevekrouse
0
ljus avatar
ljus
weatherGPT
HTTP
WeatherGPT Using OpenAI chat completion (GPT3) with function calls to SMHI api The API is instructed to use the current time in Europe/Stockholm timezone. If the message can not be handled with the weather API endpoint, the Open AI assistant will reply instead. Relevant API documentation SMHI, forecast documentation OPEN AI, GPT function calling documentation How to use this endpoint GET: RUN_ENDPOINT?args=["A weather question"] Response { answer?: string // If the message could not be answered with the SMHI API error?:string // data?: unknown // the actual data returned from SMHI, if the API is called summary?: string // a summary of the data, by GPT API } Examples How is the weather in the Capital of Sweden tomorrow. How is the weather at Liseberg on Friday. Packages used zod: for describing the SMHI API response and function API input zod-to-json-schema: Transform the zod schema to json schema (readable by the GPT API) gpt3-tokenizer: count the number of tokens date-fns-tz: To handle dates in a specific timezone (Europe/Stockholm)
0
oijoijcoiejoijce avatar
oijoijcoiejoijce
VALLE
HTTP
Forked from janpaul123/VALLE
0
weaverwhale avatar
weaverwhale
GistGPT
HTTP
GistGPT A helpful assistant who provides the gist of a gist How to use / and /gist - Default response is to explain this file. I believe this is effectively real-time recursion ? /gist?url={URL} - Provide a RAW file URL from Github, BitBucket, GitLab, Val Town, etc. and GistGPT will provide you the gist of the code. /about - "Tell me a little bit about yourself"
0
jpwilliams avatar
jpwilliams
getVersion
HTTP
An interactive, runnable TypeScript val by jpwilliams
1
andreterron avatar
andreterron
pngTest
HTTP
An interactive, runnable TypeScript val by andreterron
0
devdoshi avatar
devdoshi
whatIsMyIp
Script
I wanted to see if val.town forwards my client IP Address using the x-forwarded-for header, which it does, but cloudflare provides the True-Client-IP header as well. When you run a val on the website, it is actually running from val's servers so it won't come from your client IP. You'll need to copy the express fetch and run that from your client.
0
dthyresson avatar
dthyresson
graphQLYoga
HTTP
GraphQL Yoga Server GraphQL Yoga from The Guild is a batteries-included cross-platform GraphQL over HTTP spec-compliant GraphQL server powered by Envelop and GraphQL Tools focused on easy setup, performance and great developer experience. Usage To access GraphiQL - the GraphQL Playground - visit the / route. That's what you see in the preview pane below. Configuration and Documentation See the GraphQL Yoga documentation for configuration and all the bells and whistles. Endpoint For this example, we'll set to / to make it easier to demo. However, by default, the GraphQL route is configured to be on /graphql which is more common. const yoga = createYoga({ schema, }) You can set a custom endpoint: const yoga = createYoga({ schema, graphqlEndpoint: "/my-gql", }) Landing Page A landing page is shown be default whenever a 404 is hit. You can disable it via the landingPage option. const yoga = createYoga({ schema, landingPage: false })
0
tmcw avatar
tmcw
express_example
Script
This val is simple, and just a way to test the express API.
1
erlenstar avatar
erlenstar
rockSevenEndpoint
Script
An interactive, runnable TypeScript val by erlenstar
0