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/image-url.jpg%20%22Optional%20title%22?q=api&page=43&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 21430 results for "api"(6340ms)

twitterNewTweetAlertmain.tsx2 matches

@axldefiโ€ขUpdated 5 days ago
4
5if (!discordWebhookUrl) {
6 throw new Error("Either Discord webhook URL or Telegram bot API token and user ID must be provided.");
7}
8
191
192 if (!response.ok) {
193 throw new Error(`Discord API responded with status: ${response.status}`);
194 }
195}

saveTextToPodcastindex.ts11 matches

@larryhudsonโ€ขUpdated 5 days ago
203}
204
205// Convert a single text chunk to speech using Deepgram's TTS API with callback
206async function textChunkToSpeechWithCallback(
207 text: string,
210 callbackUrl: string,
211): Promise<void> {
212 const deepgramApiKey = Deno.env.get("DEEPGRAM_API_KEY");
213 if (!deepgramApiKey) {
214 throw new Error("DEEPGRAM_API_KEY environment variable is required");
215 }
216
237 try {
238 const response = await fetch(
239 `https://api.deepgram.com/v1/speak?model=${model}&callback_url=${callbackUrlEncoded}`,
240 {
241 method: "POST",
242 headers: {
243 "Authorization": `Token ${deepgramApiKey}`,
244 "Content-Type": "application/json",
245 },
250 if (!response.ok) {
251 const error = await response.text();
252 console.error("Deepgram API Error Details:", {
253 status: response.status,
254 statusText: response.statusText,
258 textLength: cleanText.length,
259 });
260 throw new Error(`Deepgram TTS API error: ${response.status} - ${error}`);
261 }
262
264 } catch (fetchError) {
265 console.error("Fetch error:", fetchError);
266 throw new Error(`Network error calling Deepgram API: ${fetchError.message}`);
267 }
268}
298 // Verify the request is from Deepgram by checking the dg-token header
299 const dgToken = c.req.header("dg-token");
300 const expectedToken = Deno.env.get("DEEPGRAM_API_KEY");
301
302 if (!dgToken || dgToken !== expectedToken) {
687app.get("/", (c) => {
688 return c.json({
689 message: "Text-to-Speech API with Deepgram Callbacks",
690 endpoints: {
691 "POST /convert": "Start async text-to-speech conversion (requires: Authorization header, file, name)",

syncbeatmain.tsx2 matches

@joinโ€ขUpdated 5 days ago
215 const SEVEN_NOTE_FORM = [0, 3, 6, 8, 10, 12, 14];
216 const SINGLE_LINE_HEIGHT_PX = 150;
217 const API_ENDPOINT = 'generate';
218
219 // --- DOM ELEMENTS ---
352 }
353 try {
354 const response = await fetch(API_ENDPOINT, { method: 'POST' });
355 if (!response.ok) throw new Error(\`Server responded with \${response.status}\`);
356 const data = await response.json();

learning-botmain.tsx1 match

@ictuerโ€ขUpdated 5 days ago
3
4const bot = new Bot(Deno.env.get("TELEGRAM_TOKEN")!);
5bot.api.sendMessage("5427167514", "Hello!");
6
7// Appending to a sheet

learning-botnew-file-4258.ts2 matches

@ictuerโ€ขUpdated 5 days ago
15});
16
17bot.api.sendMessage("5427167514", "Hello!");
18
19// Use part of the TELEGRAM_TOKEN itself as the secret_token
35 // This is a no-op if nothing's changed
36 if (!isEndpointSet) {
37 await bot.api.setWebhook(req.url, {
38 secret_token: SECRET_TOKEN,
39 });

AIDAREADME.md8 matches

@spookyโ€ขUpdated 6 days ago
42- **3D Rendering**: Three.js with WebGL
43- **Styling**: Tailwind CSS with custom components
44- **Backend**: Hono.js for API endpoints
45- **Mathematics**: Custom libraries for higher-dimensional calculations
46- **Platform**: Val Town serverless environment
105```
106โ”œโ”€โ”€ backend/
107โ”‚ โ”œโ”€โ”€ index.ts # Main API server with Hono
108โ”‚ โ””โ”€โ”€ routes/ # API endpoints for calculations
109โ”œโ”€โ”€ frontend/
110โ”‚ โ”œโ”€โ”€ components/
128```
129
130## ๐Ÿ”ง API Endpoints
131
132- `GET /`: Main application interface
133- `GET /api/health`: Application health check
134- `GET /api/shapes/:dimension/:shape`: Shape metadata and properties
135- `POST /api/calculate`: Mathematical computation endpoints
136- `GET /api/performance`: Performance monitoring data
137
138## ๐ŸŽ“ Educational Value

AIDAGeometryViewer.tsx35 matches

@spookyโ€ขUpdated 6 days ago
255 }, [container, appState.camera, appState.lighting, appState.rendering.showFaces]);
256
257 // Enhanced geometry update with backend API integration
258 const updateGeometry = useCallback(async () => {
259 if (!geometryGroupRef.current) return;
280
281 try {
282 // Use backend API for shape generation and projection
283 let apiResponse;
284 let projectedVertices: Vector3D[] = [];
285 let edges: { start: number; end: number }[] = [];
287
288 if (appState.dimension === 4) {
289 // Call 4D shape API
290 const response = await fetch('/api/calculate/shape4d', {
291 method: 'POST',
292 headers: {
300
301 if (!response.ok) {
302 throw new Error(`API Error: ${response.status} ${response.statusText}`);
303 }
304
305 apiResponse = await response.json();
306
307 if (!apiResponse.success) {
308 throw new Error(apiResponse.error || 'Failed to generate 4D shape');
309 }
310
311 // Extract projected data from API response
312 projectedVertices = apiResponse.projected3D.vertices;
313 edges = apiResponse.projected3D.edges;
314 faces = apiResponse.projected3D.faces;
315
316 // Update performance stats
317 setRenderStats({
318 vertices: apiResponse.metadata.vertices,
319 faces: apiResponse.metadata.faces || faces.length,
320 drawCalls: (appState.rendering.showVertices ? 1 : 0) +
321 (appState.rendering.showEdges ? 1 : 0) +
326 const vertexCountElement = document.getElementById('vertexCount');
327 if (vertexCountElement) {
328 vertexCountElement.textContent = apiResponse.metadata.vertices.toString();
329 }
330
331 // Pass shape data to parent for cross-section analysis
332 if (onShapeGenerated) {
333 onShapeGenerated(apiResponse.shape4D);
334 }
335
336 } else if (appState.dimension === 5) {
337 // Call 5D shape API
338 const response = await fetch('/api/calculate/shape5d', {
339 method: 'POST',
340 headers: {
348
349 if (!response.ok) {
350 throw new Error(`API Error: ${response.status} ${response.statusText}`);
351 }
352
353 apiResponse = await response.json();
354
355 if (!apiResponse.success) {
356 throw new Error(apiResponse.error || 'Failed to generate 5D shape');
357 }
358
359 // Extract projected data from API response
360 projectedVertices = apiResponse.projected3D.vertices;
361 edges = apiResponse.projected3D.edges;
362 faces = apiResponse.projected3D.faces;
363
364 // Update performance stats
365 setRenderStats({
366 vertices: apiResponse.metadata.vertices,
367 faces: apiResponse.metadata.faces || faces.length,
368 drawCalls: (appState.rendering.showVertices ? 1 : 0) +
369 (appState.rendering.showEdges ? 1 : 0) +
374 const vertexCountElement = document.getElementById('vertexCount');
375 if (vertexCountElement) {
376 vertexCountElement.textContent = apiResponse.metadata.vertices.toString();
377 }
378 }
379
380 // Create enhanced 3D visualization with API data
381 await createEnhancedVisualization(projectedVertices, edges, faces);
382
383 // Handle cross-sections with backend API
384 if (appState.crossSection.enabled && apiResponse) {
385 try {
386 const crossSectionResponse = await fetch('/api/calculate/cross-section', {
387 method: 'POST',
388 headers: {
390 },
391 body: JSON.stringify({
392 shape: appState.dimension === 4 ? apiResponse.shape4D : apiResponse.shape5D,
393 hyperplane: {
394 position: appState.crossSection.position,

FrontendQAExampleindex.ts2 matches

@onkernelโ€ขUpdated 6 days ago
12app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
13
14// Add your API routes here
15// app.get("/api/data", c => c.json({ hello: "world" }));
16
17// Unwrap and rethrow Hono errors as the original error

saveTextToPodcastREADME.md7 matches

@larryhudsonโ€ขUpdated 6 days ago
1# Text-to-Speech API with Deepgram Callbacks
2
3This HTTP Val converts text files to speech using Deepgram's TTS API with async callbacks to handle large files without timeouts.
4
5## Setup
6
71. Set the `DEEPGRAM_API_KEY` environment variable in your Val Town settings
82. Set the `AUTH_TOKEN` environment variable for API authorization
93. The SQLite database tables will be created automatically on first use
10
23
241. Visit `/test` for a web interface to upload and convert text files
252. Or use the API endpoints directly (see below)
26
27## API Endpoints
28
29### GET /test
178
179- **POST /convert**: Requires `Authorization: Bearer YOUR_TOKEN` header
180- **POST /deepgram-callback**: Validates `dg-token` header matches `DEEPGRAM_API_KEY`
181- **GET /podcast.xml**: Requires `?key=YOUR_TOKEN` query parameter
182- All other endpoints (episodes list, audio serving, test page, job status) are public

untitled-5156main.tsx2 matches

@dr_hexโ€ขUpdated 6 days ago
52 }
53 if (link?.includes("pixeld")) {
54 if (!link?.includes("api")) {
55 const token = link.split("/").pop();
56 const baseUrl = link.split("/").slice(0, -2).join("/");
57 link = `${baseUrl}/api/file/${token}?download`;
58 }
59 streamLinks.push({ server: "Pixeldrain", link: link, type: "mkv" });

custom-domains-val-api

@nbbaierโ€ขUpdated 4 hours ago

custom-domains-val-api

@stevekrouseโ€ขUpdated 6 hours ago
fiberplane
Purveyors of Hono tooling, API Playground enthusiasts, and creators of ๐Ÿชฟ HONC ๐Ÿชฟ (https://honc.dev)
api