Back to APIs list

Air quality API examples & templates

Use these vals as a playground to view and fork Air quality API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
shanberg avatar
theme
@shanberg
Script
An interactive, runnable TypeScript val by shanberg
catapart avatar
testTokenizer
@catapart
Script
An interactive, runnable TypeScript val by catapart
vprtwn avatar
IllustratedPrimer
@vprtwn
HTTP (deprecated)
Forked from stevekrouse/openAIStreamingExample
martinbowling avatar
imgGenUrl
@martinbowling
HTTP (deprecated)
Forked from andrewgao/imgGenUrl
tfayyaz avatar
honoDatabricksU2MAuth
@tfayyaz
HTTP (deprecated)
Forked from tfayyaz/honoHtmxJsTemplate
jdan avatar
randomJumbledPairwiseWords
@jdan
Script
An interactive, runnable TypeScript val by jdan
Olive avatar
linkInBioTemplate
@Olive
HTTP (deprecated)
Forked from stevekrouse/linkInBioTemplate
iamseeley avatar
resumeDetails
@iamseeley
HTTP (deprecated)
💼 Thomas Seeley's resume in the JSON Resume standard
decepulis avatar
MuxAITranscript
@decepulis
HTTP (deprecated)
Generate CuePoints and transcripts for your Mux video Adapted from the blog post, Build an AI-powered interactive video transcript with Mux Player CuePoints This Val exposes an HTTP endpoint that takes a Mux Asset ID and a list of speakers and Uses Mux's auto-generated captions to generate a CuePoints object for Mux Player Uses AssemblyAI for speaker labeling (diarization) Uses GPT-4o to format text Fork it and use it as a foundation for your own interactive video transcript project. Usage: Required environment variables: Mux Access token details ( MUX_TOKEN_ID , MUX_TOKEN_SECRET ) This endpoint requires an existing Mux asset that's ready with an audio-only static rendition associated with it. You can run this val to create a new one for testing. AssemblyAI API key ( ASSEMBLYAI_API_KEY ). Get it from their dashboard here OpenAI API key ( OPENAI_API_KEY ). Get it from their dashboard here Make a POST request to the Val's endpoint with the following body, replacing the values with your own asset ID and the list of speakers. Speakers are listed in order of appearance. { "asset_id": "00OZ8VnQ01wDNQDdI8Qw3kf01FkGTtkMq2CW901ltq64Jyc", "speakers": ["Matt", "Nick"] } Limitations This is just a demo, so it's obviously not battle hardened. The biggest issue is that it does this whole process synchronously, so if the any step takes longer than the Val's timeout, you're hosed.
dthyresson avatar
bedtimeStoryActivities
@dthyresson
Script
An interactive, runnable TypeScript val by dthyresson
webup avatar
pipeSampleMap
@webup
Script
An interactive, runnable TypeScript val by webup
airon21 avatar
myApi
@airon21
Script
An interactive, runnable TypeScript val by airon21
fil avatar
cron_rezo_rss2bsky
@fil
Cron
Passerelle RSS vers BlueSky Ce script tourne une fois par heure et reposte les news de https://rezo.net/ vers le compte https://bsky.app/profile/rezo.net Il utilise 3 éléments: l'URL du flux RSS une variable de stockage de l'état, qu'il faut créer initialement comme let storage_rss_rezo = {} et qui sera mise à jour par le script les secrets du compte (username et mot de passe de l'application) Il appelle @me.bsky_rss_poll qui lit le flux, vérifie avec l'état s'il y a du nouveau, et au besoin nettoie le post, puis l'envoie avec le script @me.post_to_bsky . Sans oublier de mettre à jour l'état pour le prochain run. C'est un premier jet. Merci à @steve.krouse pour val.town et à @jordan pour ses scripts que j'ai bidouillés ici. À faire éventuellement: améliorer la logique; poster vers twitter .
yieldray avatar
decorator_router
@yieldray
Script
Decorator Router Fair simple decorator based router, with GET/POST and middleware support. demo live demo: https://yieldray-decorator_router_demo.web.val.run/ import { get, post, all, use, registered, handler, type Context } from "https://esm.town/v/yieldray/decorator_router"; import { parseBearerAuth, transformResponse } from "https://esm.sh/serve-router@1.1.0/utils"; interface User { id: number; name: string; } const users: User[] = [ { id: 0, name: "Alice" }, { id: 1, name: "Ray" }, ]; class _Server { /** * Decorator @get: Parses URLSearchParams into an object as the first parameter. */ @get("/users") getAllUsers() { return users; // Automatically wrapped in a Response.json } @get("/getUserByName") // GET /getUserByName?name=Alice getUserByName({ name }: Record<string, string>) { const user = users.find((u) => u.name === name); if (user) { return user; // Automatically wrapped as Response.json(user) } // Optionally, manually return a Response object return Response.json({ error: "not found" }, { status: 404 }); } @get("/user/:id") // GET /user/123 user(_: unknown, { params: { id } }: Context) { return users.find((u) => u.id === Number(id)); } /** * Decorator @post: Parses the request body into an object as the first parameter. */ @post("/user") // POST /user async createUser(user: User) { if (users.find((u) => u.id === user.id)) { return { error: "already exists!" }; } await users.push(user); // Assume insertion into a database return { ok: true, users }; } @post("/user/:id") // POST /user/123 async updateUser(user: User, { params: { id }, request }: Context) { const token = parseBearerAuth(request.headers.get("Authorization")!); // Additional logic here... } @all("/") home({ request }: { request: Request }) { return { registered, method: request.method, url: request.url, headers: Object.fromEntries(request.headers.entries()), }; } @use("/*") async corsMiddleware({ next, request }: Context) { const resp = await next(); return transformResponse(resp, { headers: { "Access-Control-Allow-Origin": request.headers.get("origin") || "*", }, }); } } // For Deno: Deno.serve(handler); // For val.town: export default handler;
nknj avatar
illustratedPrimer
@nknj
HTTP (deprecated)
Forked from substrate/illustratedPrimer
hrbrmstr avatar
cisaKEVToRSS
@hrbrmstr
HTTP
CISA KEV To RSS This val.town HTTP endpoint reads the JSON from CISA's Known Exploited Vulnerabilities Catalog and converts it to an RSS feed.