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.
yawnxyz avatar
stringInferExample
@yawnxyz
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
ljus avatar
weatherGPT
@ljus
HTTP (deprecated)
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)
siygle avatar
resumeHandler
@siygle
HTTP (deprecated)
Forked from iamseeley/resumeHandler
wlxiaozhzh avatar
VALLE
@wlxiaozhzh
HTTP (deprecated)
Forked from janpaul123/VALLE
jpwilliams avatar
getVersion
@jpwilliams
HTTP (deprecated)
An interactive, runnable TypeScript val by jpwilliams
weaverwhale avatar
GistGPT
@weaverwhale
HTTP (deprecated)
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"
shawnbasquiat avatar
placeholderKittenImages
@shawnbasquiat
HTTP
// This val creates a publicly accessible kitten image generator using the Val Town image generation API.
oijoijcoiejoijce avatar
VALLE
@oijoijcoiejoijce
HTTP (deprecated)
Forked from janpaul123/VALLE
andreterron avatar
pngTest
@andreterron
HTTP (deprecated)
An interactive, runnable TypeScript val by andreterron
dthyresson avatar
graphQLYoga
@dthyresson
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 })
devdoshi avatar
whatIsMyIp
@devdoshi
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.
erlenstar avatar
rockSevenEndpoint
@erlenstar
Script
An interactive, runnable TypeScript val by erlenstar
tmcw avatar
express_example
@tmcw
Script
This val is simple, and just a way to test the express API.
cjlm avatar
copperPartridge
@cjlm
HTTP (deprecated)
Forked from andreterron/renderFormAndSaveData
therealarkin avatar
umbrellaReminder
@therealarkin
Cron
Forked from stevekrouse/umbrellaReminder
omgwtfbrblolttyl avatar
readFileEndpoint
@omgwtfbrblolttyl
Express
An interactive, runnable TypeScript val by omgwtfbrblolttyl