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.
uniswapV3Position
midnightlightning
uniswapV3Position
An endpoint to calculate additional metadata for a Uniswap v3 liquidity position. In order to keep on-chain fees low, the Uniswap cryptocurrency exchange balances how much data it writes to the blockchain when users take out a liquidity position. Properties are saved in a few different contracts and so knowing exactly what a liquidity position entails takes a bit of additional calculation. This endpoint takes in a token identifier that represents a liquidity position, and follows the math to make the values more human-friendly. This script uses the bignumber.js library to do higher-precision floating-point math than JavaScript can do on its own with number variables. Usage Find the token ID of the Uniswap position you wish to get details about. If you own the liquidity position, you can head to https://app.uniswap.org/pool and click on the v3 position. The ID of that position will be in the URL of the details page. Append the token ID to the end of this val's URL to fetch data about it (e.g. to get information about token ID 12345 , fetch the url https://midnightlightning-uniswapv3position.web.val.run/12345 ) Reference This val fetches blockchain data from the following smart contracts: NonfungiblePositionManager( 0xc36442b4a4522e871399cd717abdd847ab11fe88 ) Manages the liquidity position tokens as an ERC721 contract. The positions function is used to determine what tokens and tick ranges the individual liquidity position has. UniswapV3Factory ( 0x1F98431c8aD98523631AE4a59f267346ea31F984 ) Contract that manages liquidity pools, and acts as a registry to record where each pairing is deployed to. The getPool function is used to find where the smart contract for a specific pairing of ERC20 tokens is deployed to. ERC20 tokens Each position has two tokens it's balancing between, and each token has its own instance of an ERC20 contract deployed to the blockchain. The name and symbol functions are used to determine how to describe each token, and the decimals function to determine how to scale the price value for the ratio between them. UniswapV3Pool Contract that handles swaps between specific pairs of tokens. The slot0 function is used to fetch the current price the two tokens are swapping at.
findSlamArticles
dupontgu
findSlamArticles
An interactive, runnable TypeScript val by dupontgu
ZineFairs
sylvea
ZineFairs
// Scrapes the stencil fairs website and gets the upcoming events
hololiveAnniversaryData
stu43005
hololiveAnniversaryData
Data Source: https://seesaawiki.jp/hololivetv/d/%B5%AD%C7%B0%C6%FC Auto gen by @stu43005.genHololiveAnniversaryData
emojibasedenglishtofrenchvocabularylearning
Ttt
emojibasedenglishtofrenchvocabularylearning
Project: Emoji-Based English to French Vocabulary Learner Overview: An interactive web application designed to facilitate French vocabulary learning through a visually engaging emoji-based interface. This website presents users with a grid of items, each pairing an English word with its French equivalent and a representative emoji. Core Features: Interactive vocabulary grid Real-time search functionality Word visibility toggle Alphabetical sorting (A-Z/Z-A) Responsive layout for various devices Dynamic background color on each load Scalability: The current architecture suits small to medium vocabulary sets. For larger datasets or frequent content updates, consider implementing an external storage solution in future iterations. This application offers an effective and engaging method for French language learners, combining modern web technologies with an intuitive user interface to create an accessible educational tool.
switchbot_party
stevekrouse
switchbot_party
Remix of: stevekrouse/switchbot
primewire
temptemp
primewire
Remix of: tempdev/primewire
ai
yawnxyz
ai
An http and class wrapper for Vercel's AI SDK Usage: Groq: https://yawnxyz-ai.web.val.run/generate?prompt="tell me a beer joke"&provider=groq&model=llama3-8b-8192 Perplexity: https://yawnxyz-ai.web.val.run/generate?prompt="what's the latest phage directory capsid & tail article about?"&provider=perplexity Mistral: https://yawnxyz-ai.web.val.run/generate?prompt="tell me a joke?"&provider=mistral&model="mistral-small-latest" async function calculateEmbeddings(text) { const url = `https://yawnxyz-ai.web.val.run/generate?embed=true&value=${encodeURIComponent(text)}`; try { const response = await fetch(url); const data = await response.json(); return data; } catch (error) { console.error('Error calculating embeddings:', error); return null; } }
healthtech4africa
thomaskangah
healthtech4africa
AI Mental health support app for precision neuroscience
vtu_generateJWTKeyPair
rozek
vtu_generateJWTKeyPair
(documentation follows)
vtu_JWTisValid
rozek
vtu_JWTisValid
(documentation follows)
vtu_JWTfor
rozek
vtu_JWTfor
(documentation follows)
pageDetector
eligosmlytics
pageDetector
@jsxImportSource https://esm.sh/react
multiUserChatwithLLM
trob
multiUserChatwithLLM
@jsxImportSource https://esm.sh/react
getAirtableDataAPI
stnkvcs
getAirtableDataAPI
// Initialize Airtable configuration
tvshows
tmcw
tvshows
Remix of: Glench/tvshows