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=105&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 19249 results for "api"(4296ms)

leximain.tsx2 matches

@legal•Updated 1 week ago
653 }
654 } catch (error) {
655 const errMsg = `AI API Error: ${error.message}`;
656 log.push({ agent: agentName, type: "error", message: errMsg });
657 console.error(`${agentName} Error:`, error);
658 return { error: "AI_API_ERROR", message: errMsg, details: error.toString() };
659 }
660 }

FetchBasicmain.tsx12 matches

@ther•Updated 1 week ago
1/**
2 * Val.Town function to proxy Ticket Tailor Overview API
3 * This provides the same functionality as the Vercel serverless function
4 *
5 * Environment variables needed:
6 * - TICKET_TAILOR_API_KEY: Your Ticket Tailor API key
7 */
8export default async function handler(request: Request): Promise<Response> {
38
39 try {
40 // Get API key from environment variable
41 const apiKey = Deno.env.get("TICKET_TAILOR_API_KEY");
42
43 if (!apiKey) {
44 return new Response(
45 JSON.stringify({
46 success: false,
47 error: "API key not configured",
48 }),
49 {
55
56 // Create Basic Auth header (using btoa for base64 encoding)
57 const authHeader = `Basic ${btoa(apiKey + ":")}`;
58
59 // Call Ticket Tailor Overview API
60 const response = await fetch("https://api.tickettailor.com/v1/overview", {
61 method: "GET",
62 headers: {
68 // Check if the request was successful
69 if (!response.ok) {
70 console.error(`Ticket Tailor API error: ${response.status} ${response.statusText}`);
71 return new Response(
72 JSON.stringify({
73 success: false,
74 error: `Ticket Tailor API error: ${response.status}`,
75 details: response.statusText,
76 }),
98 );
99 } catch (error) {
100 console.error("API Error:", error);
101
102 return new Response(

cerebras_coderstarter-prompts.js1 match

@zeviper•Updated 1 week ago
12 },
13 {
14 "prompt": "weather dashboard for nyc using open-meteo API for NYC with icons",
15 "title": "Weather App",
16 "code":

cerebras_coderREADME.md2 matches

@zeviper•Updated 1 week ago
8
91. Sign up for [Cerebras](https://cloud.cerebras.ai/)
102. Get a Cerebras API Key
113. Save it in your project env variable called `CEREBRAS_API_KEY`

cerebras_coderindex.ts1 match

@zeviper•Updated 1 week ago
211 } catch (error) {
212 Toastify({
213 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
214 position: "center",
215 duration: 3000,

cerebras_coderindex.html3 matches

@zeviper•Updated 1 week ago
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>CerebrasCoder</title>
7 <link rel="preconnect" href="https://fonts.googleapis.com" />
8 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9 <link
10 href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
11 rel="stylesheet"
12 />
21 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
22 <meta property="og:type" content="website">
23 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
24
25

cerebras_codergenerate-code.ts1 match

@zeviper•Updated 1 week ago
16 };
17 } else {
18 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
19 const completion = await client.chat.completions.create({
20 messages: [

FetchBasicREADME.md1 match

@ther•Updated 1 week ago
1# Framer Fetch: Basic
2
3A basic example of an API endpoint to use with Framer Fetch.
batchcast

batchcastmain.tsx13 matches

@g•Updated 1 week ago
3 * controlling multiple Chromecast devices simultaneously.
4 * The application logic is entirely on the client-side, interacting with a
5 * user-provided backend REST API. This val only serves the static HTML, CSS,
6 * and JavaScript files.
7 */
304 // --- STATE ---
305 const PORT = 8081;
306 let apiBase = "";
307 let services = [];
308 let list = []; // Array of host strings
333 const allControlButtons = [sendMediaBtn, playBtn, pauseBtn, stopBtn, closeBtn, addAllBtn, removeAllBtn];
334
335 // --- API HELPERS ---
336 const apiCall = (endpoint, options = {}) => {
337 if (!apiBase) return Promise.reject("API base not set");
338 return fetch(`${apiBase}${endpoint}`, options);
339 };
340
341 const getStatus = () => apiCall("/status");
342 const getServices = () => apiCall("/services").then(res => res.ok ? res.json() : Promise.reject(res));
343 const getList = () => apiCall("/list").then(res => res.ok ? res.json() : Promise.reject(res));
344 const updateList = (hosts) => apiCall("/list", { method: "PUT", headers: { "Content-Type": "application/json" }, body: JSON.stringify(hosts) });
345 const deleteFromList = (hosts) => apiCall("/list", { method: "DELETE", headers: { "Content-Type": "application/json" }, body: JSON.stringify(hosts) });
346
347 const postCommand = (endpoint, body = {}) => apiCall(endpoint, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) });
348 const sendMedia = (contentId, contentType) => postCommand("/media", { contentId, contentType });
349 const stopPlayback = () => postCommand("/stop");
428 if(servicesInterval) clearInterval(servicesInterval);
429
430 apiBase = `http://${host}:${PORT}`;
431 hostInput.disabled = true;
432 connectBtn.disabled = true;

YoutubeDownloaderyoutube.ts6 matches

@bman101•Updated 1 week ago
23 // In a real implementation, you would either:
24 // 1. Use a separate service that has yt-dlp installed
25 // 2. Use YouTube API + other tools for downloading
26 // 3. Use a third-party service
27
72
73 /**
74 * Gets video information (simulated - in real implementation would use YouTube API)
75 */
76 private static async getVideoInfo(url: string): Promise<VideoInfo> {
77 const videoId = this.extractVideoId(url);
78
79 // In a real implementation, you would use YouTube Data API v3
80 // For demo purposes, we'll return mock data
81 return {
103 message: "Video downloaded successfully",
104 filename: `${videoInfo.title}.mp4`,
105 downloadUrl: `/api/download/video/${this.extractVideoId(url)}`
106 };
107 }
125 message: "Audio extracted successfully",
126 filename: `${videoInfo.title}.mp3`,
127 downloadUrl: `/api/download/audio/${this.extractVideoId(url)}`
128 };
129 }
140// 1. A server with yt-dlp installed (Python environment)
141// 2. File storage system (local filesystem, cloud storage, etc.)
142// 3. YouTube Data API key for video metadata
143// 4. Proper error handling and rate limiting
144// 5. Cleanup of temporary files

api_ianmenethil_com133 file matches

@ianmenethil•Updated 3 hours ago

api_ianmenethil_com74 file matches

@ianmenethil•Updated 11 hours ago
apiry
snartapi