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.
vez avatar
vez
addComment
Script
An interactive, runnable TypeScript val by vez
0
mutludev_ avatar
mutludev_
kelvinToCelcius
Script
An interactive, runnable TypeScript val by mutludev_
0
supaspoida avatar
supaspoida
testPush
Script
An interactive, runnable TypeScript val by supaspoida
0
maxm avatar
maxm
wideApi
HTTP
An interactive, runnable TypeScript val by maxm
0
pomdtr avatar
pomdtr
reading_and_writing_blobs
Script
#example
0
jdan avatar
jdan
latLngOfCity
Script
An interactive, runnable TypeScript val by jdan
0
muhammad_owais_warsi avatar
muhammad_owais_warsi
Whatsapp_Send
HTTP
Whatsapp Send Button Generate an embeddable code to embed a whatsapp send button onto your site.
1
stevekrouse avatar
stevekrouse
dateMeNotify
Script
// Email alerts when new Docs posted to https://DateMe.Directory
0
xxxlovecola avatar
xxxlovecola
getRandomNumber
HTTP
An interactive, runnable TypeScript val by xxxlovecola
0
yawnxyz avatar
yawnxyz
openAiHelloWorld
Script
// Create a secret named OPENAI_API_KEY at https://www.val.town/settings/environment-variables
0
Vanshii_244 avatar
Vanshii_244
urgentVoicemailApp
HTTP
@jsxImportSource https://esm.sh/react@18.2.0
0
nbbaier avatar
nbbaier
sqliteWriter
Script
SQLite QueryWriter The QueryWriter class is a utility for generating and executing SQL queries using natural language and OpenAI. It provides a simplified interface for interacting with your Val Town SQLite database and generating SQL queries based on user inputs. This val is inspired by prisma-gpt . PRs welcome! See Todos below for some ideas I have. Usage Import the QueryWriter class into your script: import { QueryWriter } from "https://esm.town/v/nbbaier/sqliteWriter"; Create an instance of QueryWriter, providing the desired table and an optional model: const writer = new QueryWriter({ table: "my_table", model: "gpt-4-1106-preview" }); Call the writeQuery() method to generate an SQL query based on a user input string: const userInput = "Show me all the customers with more than $1000 in purchases."; const query = await writer.writeQuery(userInput); Alternatively, use the gptQuery() method to both generate and execute the SQL query: const userInput = "Show me all the customers with more than $1000 in purchases."; const result = await writer.gptQuery(userInput); Handle the generated query or query result according to your application's needs. API new QueryWriter(args: { table: string; model?: string }): QueryWriter Creates a new instance of the QueryWriter class. table : The name of the database table to operate on. model (optional): The model to use for generating SQL queries. Defaults to "gpt-3.5-turbo". apiKey (optional): An OpenAI API key. Defaults to Deno.env.get("OPENAI_API_KEY") . writeQuery(str: string): Promise<string> Generates an SQL query based on the provided user input string. str : The user input string describing the desired query. Returns a Promise that resolves to the generated SQL query. gptQuery(str: string): Promise<any> Generates and executes an SQL query based on the provided user input string. str : The user input string describing the desired query. Returns a Promise that resolves to the result of executing the generated SQL query. Todos [ ] Handle multiple tables for more complex use cases [ ] Edit prompt to allow for more than just SELECT queries [ ] Allow a user to add to the system prompt maybe? [ ] Expand usage beyond just Turso SQLite to integrate with other databases
0
tmcw avatar
tmcw
lodashExample
Script
lodash Lodash is the most popular npm module. It provides helpers for functional programming, common algorithms, and a lot more. Before JavaScript had built-in methods for Array.map , lodash (and underscore before it) provided those methods.
0
pomdtr avatar
pomdtr
oauthConcept
HTTP
// oauth middleware protect the val behind github oauth
0
pomdtr avatar
pomdtr
ssr
Script
Todo [x] extract params from request paths using urlpatterns [ ] add a Form component [ ] add support for Layouts [ ] support other types url in router ("https://val.town/v/user/val" or "owner/val")
1
campsite avatar
campsite
api
Script
Campsite API Note: this Val has been deprecated. Please use our official JS/TS SDK: https://www.npmjs.com/package/campsite-client
0