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/?q=api&page=63&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 20498 results for "api"(6180ms)

waaavepoolregistermain.tsx5 matches

@exzeeex•Updated 1 week ago
51 // mailgun credentials from environment
52 const MAILGUN_DOMAIN = Deno.env.get("MAILGUN_DOMAIN");
53 const MAILGUN_API_KEY = Deno.env.get("MAILGUN_API_KEY");
54 const FROM_EMAIL = "registration@videosynthesisecosphere.com";
55
56 if (!MAILGUN_DOMAIN || !MAILGUN_API_KEY) {
57 throw new Error("Mailgun credentials not configured");
58 }
76 formData.append("text", emailBody);
77
78 const response = await fetch(`https://api.mailgun.net/v3/${MAILGUN_DOMAIN}/messages`, {
79 method: "POST",
80 headers: {
81 "Authorization": `Basic ${btoa(`api:${MAILGUN_API_KEY}`)}`,
82 },
83 body: formData,
86 if (!response.ok) {
87 const errorText = await response.text();
88 throw new Error(`Mailgun API error: ${response.status} - ${errorText}`);
89 }
90

cardamomShoppingListView.tsx3 matches

@connnolly•Updated 1 week ago
19 setLoading(true);
20 try {
21 const response = await fetch(`/api/shopping-lists/items/${itemId}`, {
22 method: "PUT",
23 headers: {
55 setLoading(true);
56 try {
57 const response = await fetch(`/api/shopping-lists/${shoppingList.id}`, {
58 method: "PUT",
59 headers: {
95 setLoading(true);
96 try {
97 const response = await fetch(`/api/shopping-lists/${shoppingList.id}`, {
98 method: "DELETE",
99 });

llm-tipsExamplePage.tsx10 matches

@cricks_unmixed4u•Updated 1 week ago
7 const [votes, setVotes] = useState({ whisper: 0, assembly: 0, local: 0 });
8 const [userVotes, setUserVotes] = useState(0);
9 const [apiKey, setApiKey] = useState('');
10 const [youtubeUrl, setYoutubeUrl] = useState('');
11 const [curlCommand, setCurlCommand] = useState('');
21
22 const generateCurlCommand = () => {
23 if (!apiKey || !youtubeUrl) return alert('Please enter both API key and YouTube URL');
24 setCurlCommand(
25 `curl -X GET 'https://api.supadata.ai/v1/youtube/transcript?url=${encodeURIComponent(
26 youtubeUrl
27 )}&text=true' \\\n -H 'x-api-key: ${apiKey}'`
28 );
29 };
61 >
62 {m === 'notebook' && 'Method A: NotebookLM'}
63 {m === 'yt-transcript' && 'Method B: Supadata API'}
64 {m === 'vote' && 'Method C: Vote for New Method!'}
65 </button>
89 <div className="bg-gray-100 p-6 rounded-lg mb-6">
90 <div className="mb-4">
91 <label className="block text-sm font-medium text-gray-700 mb-2">Supadata API Key:</label>
92 <input
93 type="password"
94 value={apiKey}
95 onChange={(e) => setApiKey(e.target.value)}
96 className="w-full px-3 py-2 border rounded-md"
97 placeholder="sd_your_api_key_here"
98 />
99 </div>
132 <div className="flex justify-between items-center">
133 <div>
134 <h5 className="font-medium capitalize">{opt}</h5>
135 <p className="text-sm text-gray-600">
136 {opt === 'whisper' && 'Direct audio transcription using Whisper'}

cardamomApp.tsx2 matches

@connnolly•Updated 1 week ago
40 setState(prev => ({ ...prev, loading: true, error: null }));
41 try {
42 const response = await fetch('/api/recipes');
43 const data = await response.json();
44
68 setState(prev => ({ ...prev, loading: true, error: null }));
69 try {
70 const response = await fetch('/api/shopping-lists');
71 const data = await response.json();
72

cardamomshopping-lists.ts24 matches

@connnolly•Updated 1 week ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import type { ShoppingList, ShoppingListItem, CreateShoppingListRequest, ApiResponse } from "../../shared/types.ts";
3import {
4 createShoppingList as dbCreateShoppingList,
18 try {
19 const lists = await getAllShoppingLists();
20 return c.json({ success: true, data: lists } as ApiResponse<ShoppingList[]>);
21 } catch (error) {
22 console.error('Error fetching shopping lists:', error);
23 return c.json({ success: false, error: 'Failed to fetch shopping lists' } as ApiResponse, 500);
24 }
25});
30 const id = parseInt(c.req.param('id'));
31 if (isNaN(id)) {
32 return c.json({ success: false, error: 'Invalid shopping list ID' } as ApiResponse, 400);
33 }
34
35 const list = await getShoppingListById(id);
36 if (!list) {
37 return c.json({ success: false, error: 'Shopping list not found' } as ApiResponse, 404);
38 }
39
40 return c.json({ success: true, data: list } as ApiResponse<ShoppingList>);
41 } catch (error) {
42 console.error('Error fetching shopping list:', error);
43 return c.json({ success: false, error: 'Failed to fetch shopping list' } as ApiResponse, 500);
44 }
45});
54 success: false,
55 error: 'At least one recipe ID is required'
56 } as ApiResponse, 400);
57 }
58
63 success: false,
64 error: 'All recipe IDs must be valid numbers'
65 } as ApiResponse, 400);
66 }
67
76
77 const list = await dbCreateShoppingList(listName, validRecipeIds);
78 return c.json({ success: true, data: list } as ApiResponse<ShoppingList>, 201);
79 } catch (error) {
80 console.error('Error creating shopping list:', error);
81 return c.json({ success: false, error: 'Failed to create shopping list' } as ApiResponse, 500);
82 }
83});
88 const id = parseInt(c.req.param('id'));
89 if (isNaN(id)) {
90 return c.json({ success: false, error: 'Invalid shopping list ID' } as ApiResponse, 400);
91 }
92
97 success: false,
98 error: 'Shopping list name is required'
99 } as ApiResponse, 400);
100 }
101
102 const success = await updateShoppingListName(id, name.trim());
103 if (!success) {
104 return c.json({ success: false, error: 'Shopping list not found' } as ApiResponse, 404);
105 }
106
107 // Return the updated shopping list
108 const updatedList = await getShoppingListById(id);
109 return c.json({ success: true, data: updatedList } as ApiResponse<ShoppingList>);
110 } catch (error) {
111 console.error('Error updating shopping list name:', error);
112 return c.json({ success: false, error: 'Failed to update shopping list name' } as ApiResponse, 500);
113 }
114});
119 const id = parseInt(c.req.param('id'));
120 if (isNaN(id)) {
121 return c.json({ success: false, error: 'Invalid item ID' } as ApiResponse, 400);
122 }
123
126 const success = await updateShoppingListItem(id, updates);
127 if (!success) {
128 return c.json({ success: false, error: 'Item not found or no changes made' } as ApiResponse, 404);
129 }
130
131 return c.json({ success: true, data: { updated: true } } as ApiResponse);
132 } catch (error) {
133 console.error('Error updating shopping list item:', error);
134 return c.json({ success: false, error: 'Failed to update item' } as ApiResponse, 500);
135 }
136});
141 const id = parseInt(c.req.param('id'));
142 if (isNaN(id)) {
143 return c.json({ success: false, error: 'Invalid shopping list ID' } as ApiResponse, 400);
144 }
145
146 const deleted = await deleteShoppingList(id);
147 if (!deleted) {
148 return c.json({ success: false, error: 'Shopping list not found' } as ApiResponse, 404);
149 }
150
151 return c.json({ success: true, data: { deleted: true } } as ApiResponse);
152 } catch (error) {
153 console.error('Error deleting shopping list:', error);
154 return c.json({ success: false, error: 'Failed to delete shopping list' } as ApiResponse, 500);
155 }
156});

demoSDKmain.tsx1 match

@chadparker•Updated 1 week ago
59 // description: val.description,
60 // url: val.links.html,
61 // apiUrl: val.links.self
62 // })),
63 allVals: vals.map(val => val),

llm-tipsexample.tsx10 matches

@cricks_unmixed4u•Updated 1 week ago
6 const [votes, setVotes] = useState({ whisper: 0, assembly: 0, local: 0 });
7 const [userVotes, setUserVotes] = useState(0);
8 const [apiKey, setApiKey] = useState('');
9 const [youtubeUrl, setYoutubeUrl] = useState('');
10 const [curlCommand, setCurlCommand] = useState('');
20
21 const generateCurlCommand = () => {
22 if (!apiKey || !youtubeUrl) return alert('Please enter both API key and YouTube URL');
23 setCurlCommand(
24 `curl -X GET 'https://api.supadata.ai/v1/youtube/transcript?url=${encodeURIComponent(
25 youtubeUrl
26 )}&text=true' \\\n -H 'x-api-key: ${apiKey}'`
27 );
28 };
60 >
61 {m === 'notebook' && 'Method A: NotebookLM'}
62 {m === 'yt-transcript' && 'Method B: Supadata API'}
63 {m === 'vote' && 'Method C: Vote for New Method!'}
64 </button>
88 <div className="bg-gray-100 p-6 rounded-lg mb-6">
89 <div className="mb-4">
90 <label className="block text-sm font-medium text-gray-700 mb-2">Supadata API Key:</label>
91 <input
92 type="password"
93 value={apiKey}
94 onChange={(e) => setApiKey(e.target.value)}
95 className="w-full px-3 py-2 border rounded-md"
96 placeholder="sd_your_api_key_here"
97 />
98 </div>
131 <div className="flex justify-between items-center">
132 <div>
133 <h5 className="font-medium capitalize">{opt}</h5>
134 <p className="text-sm text-gray-600">
135 {opt === 'whisper' && 'Direct audio transcription using Whisper'}

Glimpsedatabase.api.routes.ts0 matches

@lightweight•Updated 1 week ago
1import { Hono } from "npm:hono";
2import { getDatabase } from "../../controllers/database.controller.ts";
3
4const app = new Hono();
5

GlimpsedemosToCache.controller.ts1 match

@lightweight•Updated 1 week ago
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7

llm-tipsexample.html16 matches

@cricks_unmixed4u•Updated 1 week ago
74 onclick="selectMethod('yt-transcript')"
75 >
76 Method B: Supadata API
77 </button>
78 <button
113 <div id="yt-transcript-method" class="method-content bg-gray-100 p-6 rounded-lg mb-6 hidden">
114 <p class="text-base text-gray-600 mb-4">
115 Use Supadata's API to get YouTube transcripts programmatically:
116 </p>
117
118 <div class="mb-4">
119 <label for="apiKey" class="block text-sm font-medium text-gray-700 mb-2">
120 Supadata API Key:
121 </label>
122 <input
123 type="password"
124 id="apiKey"
125 placeholder="sd_your_api_key_here"
126 class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
127 />
128 <p class="text-xs text-gray-500 mt-1">
129 Get your API key from <a href="https://supadata.ai" target="_blank" class="text-blue-600 underline">supadata.ai</a>
130 </p>
131 </div>
165 <div class="mt-4 p-3 bg-blue-50 rounded border-l-4 border-blue-400">
166 <p class="text-sm text-blue-700">
167 <strong>Tip:</strong> This API method gives you clean transcript data that you can pipe directly into vim or save to a file for processing.
168 </p>
169 </div>
183 <div class="flex justify-between items-center">
184 <div>
185 <h5 class="font-medium">OpenAI Whisper API</h5>
186 <p class="text-sm text-gray-600">Direct audio transcription using Whisper</p>
187 </div>
299
300 function generateCurlCommand() {
301 const apiKey = document.getElementById('apiKey').value;
302 const youtubeUrl = document.getElementById('youtubeUrl').value;
303
304 if (!apiKey || !youtubeUrl) {
305 alert('Please enter both API key and YouTube URL');
306 return;
307 }
308
309 const curlCommand = `curl -X GET 'https://api.supadata.ai/v1/youtube/transcript?url=${encodeURIComponent(youtubeUrl)}&text=true' \\
310 -H 'x-api-key: ${apiKey}'`;
311
312 document.getElementById('curlCommand').textContent = curlCommand;
347{ NEW YOUTUBE SOURCE
348
349Excerpts from the transcript of the video "AI Snake Oil: What Artificial Intelligence Can Do, What It Can't, and How to Tell the Difference" uploaded on the YouTube channel "MIT Shaping the Future of Work Initiative":
350
351[1] ASU OZDAGLAR: Maybe we should get started, right? Hi, everyone. It's a pleasure to welcome you all to tonight's talk with Professor Arvind Narayanan. The Schwarzman College of Computing is honored to co-host this event with MIT's Shaping the Future of Work Initiative...</pre>
352 </div>
353

api-workshop

@danarddanielsjr•Updated 1 day ago

API_WORKSHOP

@justjordan15•Updated 1 day ago
replicate
Run AI with an API
fiberplane
Purveyors of Hono tooling, API Playground enthusiasts, and creators of 🪿 HONC 🪿 (https://honc.dev)