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%22Image%20title%22?q=api&page=107&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 13052 results for "api"(817ms)

cerebras_codermain.tsx5 matches

@poaroxUpdated 5 days ago
212 } catch (error) {
213 Toastify({
214 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
215 position: "center",
216 duration: 3000,
971 };
972 } else {
973 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
974 const completion = await client.chat.completions.create({
975 messages: [
1096 <meta name="viewport" content="width=device-width, initial-scale=1.0">
1097 <title>CerebrasCoder</title>
1098 <link rel="preconnect" href="https://fonts.googleapis.com" />
1099 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1100 <link
1101 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"
1102 rel="stylesheet"
1103 />
1112 <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."">
1113 <meta property="og:type" content="website">
1114 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1115
1116

ValTown-Package-Trackerindex.html2 matches

@jhillerUpdated 5 days ago
151 async function loadDevices() {
152 try {
153 const response = await fetch('/api/devices');
154 const devices = await response.json();
155
175 try {
176 const deviceId = deviceSelector.value;
177 const url = deviceId ? `/api/locations?deviceId=${deviceId}` : '/api/locations';
178
179 const response = await fetch(url);

ValTown-Package-Trackerindex.ts22 matches

@jhillerUpdated 5 days ago
40
41// Debug endpoint to check system status
42app.get("/api/debug/status", async (c) => {
43 try {
44 // Check database connection
93app.get("/frontend/*", (c) => serveFile(c.req.path, import.meta.url));
94
95// API endpoint to receive ChirpStack payloads
96app.post("/api/location", async (c) => {
97 console.log("[INGEST] Received payload request");
98
186});
187
188// API endpoint to get location history
189app.get("/api/locations", async (c) => {
190 console.log("[API] Fetching location history");
191
192 try {
193 const deviceId = c.req.query("deviceId");
194 if (deviceId) {
195 console.log(`[API] Filtering locations by device ID: ${deviceId}`);
196 } else {
197 console.log("[API] Fetching all locations (no device filter)");
198 }
199 const { rows } = await getLocationHistory(deviceId);
203 );
204 console.log(
205 `[API] Retrieved ${rows.length} total, ${filtered.length} in North America`
206 );
207 return c.json(filtered);
208
209 } catch (error) {
210 console.error("[API] Error fetching location history:", error);
211 return c.json({
212 error: "Database error",
217});
218
219// API endpoint to get a specific location
220app.get("/api/locations/:id", async (c) => {
221 try {
222 const idParam = c.req.param("id");
223 console.log(`[API] Fetching location with ID: ${idParam}`);
224
225 const id = parseInt(idParam);
226 if (isNaN(id)) {
227 console.error(`[API] Invalid location ID: ${idParam}`);
228 return c.json({
229 error: "Invalid parameter",
234 const location = await getLocationById(id);
235 if (!location) {
236 console.log(`[API] Location not found with ID: ${id}`);
237 return c.json({
238 error: "Not found",
241 }
242
243 console.log(`[API] Successfully retrieved location with ID: ${id}`);
244 return c.json(location);
245 } catch (error) {
246 console.error(`[API] Error fetching location:`, error);
247 return c.json({
248 error: "Database error",
253});
254
255// API endpoint to get list of devices
256app.get("/api/devices", async (c) => {
257 console.log("[API] Fetching device list");
258
259 try {
260 const devices = await getDevices();
261 console.log(`[API] Successfully retrieved ${devices.rows.length} devices`);
262 return c.json(devices.rows);
263 } catch (error) {
264 console.error("[API] Error fetching devices:", error);
265 return c.json({
266 error: "Database error",

Townieuser-summary.ts1 match

@devdoshiUpdated 6 days ago
20 SUM(num_images) as total_images
21 FROM ${USAGE_TABLE}
22 WHERE our_api_token = 1
23 GROUP BY user_id, username
24 ORDER BY total_price DESC

TownieuseProject.tsx2 matches

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

TownieuseProjects.tsx1 match

@devdoshiUpdated 6 days ago
1import { useState, useEffect } from "https://esm.sh/react@18.2.0?dev";
2
3const ENDPOINT = "/api/projects-loader";
4
5export function useProjects () {

TownieuseCreateProject.tsx1 match

@devdoshiUpdated 6 days ago
1import { useState, useEffect } from "https://esm.sh/react@18.2.0?dev";
2
3const ENDPOINT = "/api/create-project";
4
5export function useCreateProject () {

TownieuseCreateBranch.tsx1 match

@devdoshiUpdated 6 days ago
1import { useState, useEffect } from "https://esm.sh/react@18.2.0?dev";
2
3const ENDPOINT = "/api/create-branch";
4
5export function useCreateBranch (projectId: string) {

TownieuseChatLogic.ts2 matches

@devdoshiUpdated 6 days ago
14 project,
15 branchId,
16 // anthropicApiKey,
17 // bearerToken,
18 selectedFiles,
33 status,
34 } = useChat({
35 api: "/api/send-message",
36 body: {
37 project,

TownieuseBranches.tsx1 match

@devdoshiUpdated 6 days ago
1import { useState, useEffect } from "https://esm.sh/react@18.2.0?dev";
2
3const ENDPOINT = "/api/project-branches";
4
5export function useBranches (projectId: string) {

vapi-minutes-db1 file match

@henrywilliamsUpdated 2 days ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 2 days ago
papimark21
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