Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Burl%7D?q=api&page=957&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=api

Returns an array of strings in format "username" or "username/projectName"

Found 12898 results for "api"(2190ms)

likelyPinkPuffinmain.tsx3 matches

@stevedylandevUpdated 8 months ago
2 * This val creates a cron job that sends an email with recent Stack Overflow posts
3 * mentioning various file upload-related topics.
4 * It uses the Stack Exchange API to fetch recent questions and the Val Town email API to send the digest.
5 */
6
7import { StackExchange } from "https://esm.sh/@userscripters/stackexchange-api-types";
8
9// Array of topics related to file uploads
22 for (const topic of TOPICS) {
23 const response = await fetch(
24 `https://api.stackexchange.com/2.3/questions?order=desc&sort=creation&site=stackoverflow&filter=withbody&tagged=${topic}&pagesize=5`,
25 );
26 const data = await response.json();

umapmain.tsx6 matches

@ejfoxUpdated 8 months ago
1/**
2 * This microservice implements a high-performance dimensionality reduction API using UMAP.
3 * It uses the umap-js library for efficient UMAP computation and implements caching for improved performance.
4 * The service accepts POST requests with JSON payloads containing high-dimensional embeddings and configuration parameters.
107 <meta charset="UTF-8">
108 <meta name="viewport" content="width=device-width, initial-scale=1.0">
109 <title>UMAP Dimensionality Reduction API</title>
110 <style>
111 body { font-family: Arial, sans-serif; line-height: 1.6; padding: 20px; max-width: 800px; margin: 0 auto; }
117</head>
118<body>
119 <h1>UMAP Dimensionality Reduction API</h1>
120 <p>This is a high-performance dimensionality reduction microservice using UMAP (Uniform Manifold Approximation and Projection). It provides an efficient way to reduce high-dimensional data to 2D or 3D representations, making it easier to visualize and analyze complex datasets.</p>
121
137
138 <h2>How to Use</h2>
139 <p>Send a POST request to this endpoint with your data to use the API. The request should include an array of embeddings and optional configuration parameters.</p>
140
141 <div class="example">
167 <p>This example shows how to use the UMAP service with OpenAI embeddings:</p>
168 <pre>
169// First, generate embeddings using OpenAI API
170import { OpenAI } from "https://esm.town/v/std/openai";
171const openai = new OpenAI();
216 .then(response => response.json())
217 .then(data => {
218 document.getElementById('result').innerHTML = '<h3>API Response:</h3><pre>' + JSON.stringify(data, null, 2) + '</pre>';
219 })
220 .catch(error => {

umapREADME.md1 match

@ejfoxUpdated 8 months ago
1# UMAP Dimensionality Reduction API
2
3This is a high-performance dimensionality reduction microservice using UMAP (Uniform Manifold Approximation and Projection). It provides an efficient way to reduce high-dimensional data to 2D or 3D representations, making it easier to visualize and analyze complex datasets.

blob_adminREADME.md1 match

@lithrelUpdated 8 months ago
9[![](https://stevekrouse-button.express.val.run/Install)](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
12
13# TODO

aqiREADME.md1 match

@sarfrazkhan18Updated 8 months ago
8
91. Click `Fork`
102. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
113. Click `Run`
12

VALLEREADME.md3 matches

@eugenechantkUpdated 8 months ago
6* Fork this val to your own profile.
7* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
8* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-variables).
9* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environment-variables).
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.
11
12<img width=500 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7077d1b5-1fa7-4a9b-4b93-f8d01d3e4f00/public"/>

telegramWebhookEchoMessagemain.tsx2 matches

@yawnxyzUpdated 8 months ago
3
4const BOT_TOKEN = Deno.env.get("TELEGRAM_TOKEN");
5const TELEGRAM_API_URL = `https://api.telegram.org/bot${BOT_TOKEN}`;
6
7useHTTP(async (req, res) => {
26async function sendMessage(chatId, text) {
27 try {
28 const url = `${TELEGRAM_API_URL}/sendMessage`;
29 const payload = {
30 chat_id: chatId,

iconExplorermain.tsx7 matches

@allUpdated 8 months ago
1/**
2 * This val creates an enhanced NPM package explorer using the npm registry API.
3 * It displays a grid of npm packages with basic information, categories, and navigation.
4 * The approach uses React for the frontend and fetch for API calls.
5 * It includes a details view for each package, a link to the npm page, and category navigation.
6 */
104 const category = url.searchParams.get("category") || "";
105
106 let apiUrl = `https://registry.npmjs.org/-/v1/search?text=${encodeURIComponent(searchTerm)}&size=${size}&from=${from}`;
107
108 if (category === "popular") {
109 apiUrl += "&popularity=1.0";
110 } else if (category === "new") {
111 apiUrl += "&maintenance=0&quality=0&popularity=0";
112 } else if (category !== "all" && category) {
113 apiUrl += `&keywords=${encodeURIComponent(category)}`;
114 }
115
116 const response = await fetch(apiUrl);
117 const data = await response.json();
118 return new Response(JSON.stringify(data), {

whatsappWebhookExamplemain.tsx2 matches

@yawnxyzUpdated 8 months ago
2 * Simple, free webhook to start using WhatsApp Platform.
3 * Handles GET request for verification, and POST request for notifications.
4 * Meta example: https://glitch.com/edit/#!/whatsapp-cloud-api-echo-bot
5 *
6 * Setup:
9 * 2. Set your env variable `WHATSAPP_WEBHOOK_VERIFY_TOKEN`
10 * Set env variables in val: https://docs.val.town/reference/environment-variables/
11 * hub.verify_token value: https://developers.facebook.com/docs/graph-api/webhooks/getting-started
12 *
13 * Note:

todaystatsmain.tsx12 matches

@ejfoxUpdated 8 months ago
1/**
2 * This tool fetches real-time data from various free APIs to create a JSON object
3 * representing the current state of the world from different perspectives.
4 * Data is cached for 30 minutes using Val Town's SQLite database to reduce API calls and improve performance.
5 */
6
43async function fetchWolframData(query: string) {
44 const appId = 'K8UTGR-8Y5G3A3VTP';
45 const url = `http://api.wolframalpha.com/v1/result?appid=${appId}&i=${encodeURIComponent(query)}`;
46 try {
47 const response = await fetch(url);
58// Utility function for fetching Alpha Vantage stock data
59async function fetchStockData(symbol: string) {
60 const apiKey = 'TD7I78XY3N2AGKWP';
61 const url = `https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=${symbol}&interval=5min&apikey=${apiKey}`;
62 try {
63 const data = await fetchJSON(url);
91
92 // If no valid cache, fetch new data
93 const issData = await fetchJSON('http://api.open-notify.org/iss-now.json');
94 const weatherData = await fetchJSON('https://api.open-meteo.com/v1/forecast?latitude=40.71&longitude=-74.01&current_weather=true&temperature_unit=celsius&daily=temperature_2m_max,temperature_2m_min,sunrise,sunset&timezone=America%2FNew_York');
95 const airQualityData = await fetchJSON('https://api.waqi.info/feed/geo:40.71;-74.01/?token=demo');
96 const cryptoData = await fetchJSON('https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum,dogecoin,ripple,cardano,polkadot,litecoin&vs_currencies=usd');
97 const peopleInSpaceData = await fetchJSON('http://api.open-notify.org/astros.json');
98 const timeData = await fetchJSON('https://worldtimeapi.org/api/timezone/America/New_York,Europe/London,Asia/Tokyo');
99 const exchangeRateData = await fetchJSON('https://api.exchangerate-api.com/v4/latest/USD');
100 const usaCovidData = await fetchJSON('https://disease.sh/v3/covid-19/countries/USA');
101 const solarData = await fetchJSON('https://services.swpc.noaa.gov/json/solar-cycle/observed-solar-cycle-indices.json');

vapi-minutes-db1 file match

@henrywilliamsUpdated 1 day ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 1 day ago
socialdata
Affordable & reliable alternative to Twitter API: ➡️ Access user profiles, tweets, followers & timeline data in real-time ➡️ Monitor profiles with nearly instant alerts for new tweets, follows & profile updates ➡️ Simple integration
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com