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.
stevekrouse avatar
telegramWebhookRemoveExample
@stevekrouse
Script
I never actually tried this out, but I think it or something like it should work based on the docs found here: https://telegram-bot-sdk.readme.io/reference/removewebhook
hootz avatar
textToImageDalle
@hootz
Script
A wrapper for OpenAI's DALLE API. See the API reference here: https://platform.openai.com/docs/api-reference/images/create?lang=curl
tahsin avatar
tomatoMinnow
@tahsin
HTTP (deprecated)
Forked from nicoalbanese/tomatoMinnow
davitchanturia avatar
VALLE
@davitchanturia
HTTP (deprecated)
Forked from janpaul123/VALLE
iamseeley avatar
hfApiGateway
@iamseeley
HTTP (deprecated)
🤖 A gateway to Hugging Face's Inference API You can perform various NLP tasks using different models . The gateway supports multiple tasks, including feature extraction, text classification, token classification, question answering, summarization, translation, text generation, and sentence similarity. Features Feature Extraction : Extract features from text using models like BAAI/bge-base-en-v1.5 . Text Classification : Classify text sentiment, emotions, etc., using models like j-hartmann/emotion-english-distilroberta-base . Token Classification : Perform named entity recognition (NER) and other token-level classifications. Question Answering : Answer questions based on a given context. Summarization : Generate summaries of longer texts. Translation : Translate text from one language to another. Text Generation : Generate text based on a given prompt. Sentence Similarity : Calculate semantic similarity between sentences. Usage Send a POST request with the required inputs to the endpoint with the appropriate task and model parameters. Or use the default models. # Example Default Model Request curl -X POST -H "Content-Type: application/json" -d '{"inputs": {"source_sentence": "Hello World", "sentences": ["Goodbye World", "How are you?", "Nice to meet you."]}}' "https://iamseeley-hfapigateway.web.val.run/?task=feature-extraction" Example Requests Feature Extraction curl -X POST -H "Content-Type: application/json" -d '{"inputs": ["Hello World", "Goodbye World"]}' "https://iamseeley-hfapigateway.web.val.run/?task=feature-extraction&model=BAAI/bge-base-en-v1.5" Feature Extraction curl -X POST -H "Content-Type: application/json" -d '{"inputs": {"source_sentence": "Hello World", "sentences": ["Goodbye World", "How are you?", "Nice to meet you."]}}' "https://iamseeley-hfapigateway.web.val.run/?task=feature-extraction&model=sentence-transformers/all-MiniLM-L6-v2" Text Classification curl -X POST -H "Content-Type: application/json" -d '{"inputs": "I love programming!"}' "https://iamseeley-hfapigateway.web.val.run/?task=text-classification&model=j-hartmann/emotion-english-distilroberta-base" Token Classification curl -X POST -H "Content-Type: application/json" -d '{"inputs": "My name is John and I live in New York."}' "https://iamseeley-hfApiGateway.web.val.run/?task=token-classification&model=dbmdz/bert-large-cased-finetuned-conll03-english" Question Answering curl -X POST -H "Content-Type: application/json" -d '{"inputs": {"question": "What is the capital of France?", "context": "The capital of France is Paris, a major European city and a global center for art, fashion, gastronomy, and culture."}}' "https://iamseeley-hfapigateway.web.val.run/?task=question-answering&model=deepset/roberta-base-squad2" Summarization curl -X POST -H "Content-Type: application/json" -d '{"inputs": "The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest man-made structure in the world, a title it held for 41 years until the Chrysler Building in New York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct."}' "https://iamseeley-hfapigateway.web.val.run/?task=summarization&model=sshleifer/distilbart-cnn-12-6" Translation curl -X POST -H "Content-Type: application/json" -d '{"inputs": "Hello, how are you?"}' "https://iamseeley-hfapigateway.web.val.run/?task=translation&model=google-t5/t5-small" Text Generation curl -X POST -H "Content-Type: application/json" -d '{"inputs": "Once upon a time"}' "https://iamseeley-hfapigateway.web.val.run/?task=text-generation&model=gpt2" Sentence Similarity curl -X POST -H "Content-Type: application/json" -d '{"inputs": {"source_sentence": "Hello World", "sentences": ["Goodbye World"]}}' "https://iamseeley-hfapigateway.web.val.run/?task=sentence-similarity&model=sentence-transformers/all-MiniLM-L6-v2" Val Examples Using Pipeline import Pipeline from "https://esm.town/v/iamseeley/pipeline"; // ... } else if (req.method === "POST") { const { inputs } = await req.json(); const pipeline = new Pipeline("task", "model"); const result = await pipeline.run(inputs); return new Response(JSON.stringify(result), { headers: { "Content-Type": "application/json" } }); } } exampleTranslation exampleTextClassification exampleFeatureExtraction exampleTextGeneration exampleSummarization exampleQuestionAnswering
janpaul123 avatar
valle_tmp_33622208006880749293871176826736
@janpaul123
HTTP (deprecated)
// This val responds to HTTP requests with "Hello, World!".
stevekrouse avatar
pythonHTTPVal
@stevekrouse
HTTP (deprecated)
Forked from iamseeley/pythonHTTPVal
lbb00 avatar
html
@lbb00
Script
Render html by tagged templates You can use this simple function to compose components, and you can also format the content within html`` elegantly in VSCode. Example const TitleTextDefault = ':)' const Title = (text)=> html`<h1>${text || TitleTextDefault}</h1>` // -> "<html><body><h1>:)</h1></body></html>" html`<html><body>${Title}</body></html>` // -> "<html><body><h1>!</h1></body></html>" html`<html><body>${Title('!')}</body></html>`
politelyinvinciblepointer avatar
handleForm
@politelyinvinciblepointer
Script
An interactive, runnable TypeScript val by politelyinvinciblepointer
panphora avatar
distance
@panphora
HTTP (deprecated)
An interactive, runnable TypeScript val by panphora
stevekrouse avatar
exampleHTTP
@stevekrouse
HTTP (deprecated)
Forked from maxm/exampleHTTP
saolsen avatar
migrations
@saolsen
Script
An interactive, runnable TypeScript val by saolsen
pomdtr avatar
blob
@pomdtr
Script
Forked from janpaul123/blob
vawogbemi avatar
dateme
@vawogbemi
HTTP (deprecated)
Forked from stevekrouse/dateme
pomdtr avatar
http_client
@pomdtr
HTTP (deprecated)
HTTP Client Attach a postman-like http client to your vals, with bookmarks and history support Usage Wrap your http handler in an the httpClient middleware. import {httpClient} from "https://esm.town/v/pomdtr/http_client" export default httpClient((req) => { return new Response("Hello World!") }) The http client will be shown on the root. Adding bookmarks You might want to bookmark some requests you need often. You can do it by passing a bookmark list as a middleware option: import {httpClient} from "https://esm.town/v/pomdtr/http_client" export default httpClient((req) => { return new Response("Hello World!") }, { bookmarks: [ { "label": "Dummy Request", "request": new Request("https://dummyjson.com/products") } ]}) Customizing the client path import {httpClient} from "https://esm.town/v/pomdtr/http_client" export default httpClient((req) => { return new Response("Hello World!") }, { path: "/http-client" }) TODO [ ] fix syntax highlighting on successive request [ ] allow to prefill the initial request
adrienj avatar
cors_proxy
@adrienj
HTTP (deprecated)
Forked from taras/cors_proxy