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?q=api&page=45&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 21546 results for "api"(6030ms)

EnglishPanda_botmain.tsx2 matches

@orguettaUpdated 6 days ago
37 }));
38 commands.push({ command: "help", description: "Show all available modes" });
39 await bot.api.setMyCommands(commands);
40 console.log("Successfully set bot commands in Telegram UI.");
41}
98 const url = new URL(req.url);
99 // שינוי קריטי: אנחנו לא שולחים יותר את האובייקט עם secret_token
100 await bot.api.setWebhook(url.href);
101 return new Response(`Webhook successfully set to ${url.href} WITHOUT a secret token.`);
102 } catch (e) {

storyBuilderstoryBuilderAPI.tsx1 match

@nmsilvaUpdated 6 days ago
1// /api/story-options.ts – Edge runtime
2import { OpenAI } from "https://esm.town/v/std/openai";
3

reactHonoStarterindex.ts2 matches

@n4k0m3Updated 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

AIDASimpleGeometryViewer.tsx3 matches

@spookyUpdated 6 days ago
160
161 try {
162 // Call API to get geometry
163 const response = await fetch(`/api/calculate/shape${dimension}d`, {
164 method: 'POST',
165 headers: { 'Content-Type': 'application/json' },
175
176 if (!response.ok) {
177 throw new Error(`API Error: ${response.status}`);
178 }
179

Townieval-summary.ts3 matches

@bootsUpdated 6 days ago
18 SUM(num_images) as total_images
19 FROM ${USAGE_TABLE}
20 WHERE val_id = ? AND our_api_token = 1
21 GROUP BY val_id
22 `, [valId]);
34 FROM ${INFERENCE_CALLS_TABLE} i
35 JOIN ${USAGE_TABLE} u ON i.usage_id = u.id
36 WHERE u.val_id = ? AND u.our_api_token = 1
37 GROUP BY u.val_id
38 `, [valId]);
41 const requestsResult = await sqlite.execute(`
42 SELECT * FROM ${USAGE_TABLE}
43 WHERE val_id = ? AND our_api_token = 1
44 ORDER BY timestamp DESC
45 `, [valId]);

Townieval-detail.ts1 match

@bootsUpdated 6 days ago
18 finish_reason?: string;
19 num_images?: number;
20 our_api_token: boolean;
21}
22

TownieuseUser.tsx1 match

@bootsUpdated 6 days ago
1import { useState, useEffect } from "react";
2
3const USER_ENDPOINT = "/api/user";
4
5export function useUser() {

Townieuser-summary.ts2 matches

@bootsUpdated 6 days ago
20 SUM(num_images) as total_images
21 FROM ${USAGE_TABLE}
22 WHERE our_api_token = 1
23 `;
24
41 FROM ${INFERENCE_CALLS_TABLE} i
42 JOIN ${USAGE_TABLE} u ON i.usage_id = u.id
43 WHERE u.our_api_token = 1
44 `;
45

Townieuser-detail.ts2 matches

@bootsUpdated 6 days ago
1import { renderLayout } from "./layout.ts";
2import { formatNumber, formatPrice, formatDate, formatBoolean } from "../utils/formatters.ts";
3import { CreditAddition } from "../api/credit-additions.ts";
4
5interface UserSummaryRow {
33 finish_reason?: string;
34 num_images?: number;
35 our_api_token: boolean;
36}
37

TownieuseProject.tsx2 matches

@bootsUpdated 6 days ago
1import { useState, useEffect } from "react";
2
3const PROJECT_ENDPOINT = "/api/project";
4const FILES_ENDPOINT = "/api/project-files";
5
6export function useProject(projectId: string, branchId?: string) {

telegram1 file match

@leduduUpdated 13 hours ago
中转telegram api

custom-domains-val-api

@nbbaierUpdated 2 days ago
replicate
Run AI with an API
fiberplane
Purveyors of Hono tooling, API Playground enthusiasts, and creators of 🪿 HONC 🪿 (https://honc.dev)