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/$%7Burl%7D?q=api&page=1186&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 19075 results for "api"(10828ms)

OpenTownieApiKeyWarning.tsx4 matches

@neverstew•Updated 2 months ago
2import React from "https://esm.sh/react@18.2.0?dev";
3
4interface ApiKeyWarningProps {
5 show: boolean;
6}
7
8export function ApiKeyWarning({ show }: ApiKeyWarningProps) {
9 if (!show) return null;
10
11 return (
12 <div className="bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700 p-4 mb-4 rounded">
13 <p className="font-bold">Anthropic API Key Missing</p>
14 <p>Please log out and add your Anthropic API key to use this app.</p>
15 </div>
16 );

ingeniousYellowRavenmain.tsx4 matches

@Learn•Updated 2 months ago
587 };
588
589 // --- API Route: /grade-card ---
590 if (request.method === "POST" && new URL(request.url).pathname === "/grade-card") {
591 try {
592 // Check for OpenAI API Key in Val Town secrets
593 const openai = new OpenAI(); // Assumes OPENAI_API_KEY is set in Val Town secrets
594 const { imageBase64 } = await request.json();
595 if (!imageBase64 || typeof imageBase64 !== "string") {
790 <meta name="viewport" content="width=device-width, initial-scale=1.0">
791 <meta charset="UTF-8">
792 <link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
793 <style>
794 /* --- START Base & Card Grader CSS --- */

campycardsmain.tsx4 matches

@find•Updated 2 months ago
587 };
588
589 // --- API Route: /grade-card ---
590 if (request.method === "POST" && new URL(request.url).pathname === "/grade-card") {
591 try {
592 // Check for OpenAI API Key in Val Town secrets
593 const openai = new OpenAI(); // Assumes OPENAI_API_KEY is set in Val Town secrets
594 const { imageBase64 } = await request.json();
595 if (!imageBase64 || typeof imageBase64 !== "string") {
805 <meta name="viewport" content="width=device-width, initial-scale=1.0">
806 <meta charset="UTF-8">
807 <link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
808 <style>
809 /* --- START Base & Card Grader CSS --- */

LoopsNewsletterFormindex.html2 matches

@valdottown•Updated 2 months ago
1<style>
2@import url('https://fonts.googleapis.com/css2?family=Inter&display=swap');
3</style><div class="newsletter-form-container">
4 <form
5 class="newsletter-form"
6 action="https://app.loops.so/api/newsletter-form/clic9j2ah00a6kz0fwvrdv41o"
7 method="POST"
8 style="display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%;"

domainSantamain.tsx1 match

@karkowg•Updated 2 months ago
256
257 <link rel="icon" href="https://karkowg-fav.web.val.run?emoji=🎅" />
258 <link href="https://fonts.googleapis.com/css2?family=Mountains+of+Christmas:wght@400;700&display=swap" rel="stylesheet">
259 <script src="https://cdn.tailwindcss.com"></script>
260 <script>

steel_puppeteer_startermain.tsx4 matches

@mattrossman•Updated 2 months ago
6});
7
8const STEEL_API_KEY = process.env.STEEL_API_KEY;
9// Initialize Steel client with the API key from environment variables
10const client = new Steel({
11 steelAPIKey: STEEL_API_KEY,
12});
13
36 // Connect Puppeteer to the Steel session
37 browser = await puppeteer.connect({
38 browserWSEndpoint: `wss://connect.steel.dev?apiKey=${STEEL_API_KEY}&sessionId=${session.id}`,
39 });
40

Cardsmain.tsx11 matches

@find•Updated 2 months ago
436 }
437
438 // --- Mock API Response ---
439 // In a real app, this section would involve a fetch call.
440 // The mock data structure should align with what renderReport expects.
495 cardName: imageFile?.name.split(".")[0] || "Uploaded Card", // For easier identification in history
496 };
497 // --- End Mock API Response ---
498
499 // Simulate API call delay
500 await new Promise(resolve => setTimeout(resolve, 2000 + Math.random() * 1000)); // 2-3 seconds delay
501
502 // Check for simulated API error randomly
503 // if (Math.random() < 0.15) { // 15% chance of error
504 // throw new Error("Simulated API Error: Could not process the image.");
505 // }
506
507 /*
508 // --- Real API Call Example ---
509 const response = await fetch("/api/grade-card", { // Your API endpoint
510 method: "POST",
511 headers: { "Content-Type": "application/json" },
514
515 if (!response.ok) {
516 let errorMsg = `API Error: ${response.status} ${response.statusText}`;
517 try {
518 const errData = await response.json();
519 errorMsg = errData.error || errorMsg; // Use specific error from API if available
520 } catch {
521 // Response wasn't JSON, use the status text
530 // Assuming 'data' is the grading report object
531 const reportData = { ...data, timestamp: generateTimestamp(), imagePreview: imageBase64 };
532 // --- End Real API Call ---
533 */
534
535 // If successful (using mock data here):
536 setPendingReportData(mockGradingReport); // Use mockGradingReport or reportData from API
537 setIsLoading(false);
538 setIsRevealingGrade(true);

versatileWhiteLizardmain.tsx1 match

@Karabo•Updated 2 months ago
146 results["trends"] = info;
147 } catch (error) {
148 console.error("Scraping error:", error);
149 } finally {
150 await browser.close();

lineByLineEchomain.tsx1 match

@jeffreyyoung•Updated 2 months ago
1import serve, { events, forward, sleep } from "https://esm.town/v/jeffreyyoung/poe_bot?v=45";
2
3// this is a theoretical new api. Under the hood it uses secret unicode characters to help us easily know where to split the text
4// it implicitly ends the previous block
5function start_new_block(options: { type?: "thinking" | "tool" | "text" } = {}) {

aircraftmain.tsx6 matches

@Learn•Updated 2 months ago
288 }
289
290 // --- Call the backend API ---
291 const response = await fetch("/analyze-aircraft", { // Match server endpoint
292 method: "POST",
779 };
780
781 // --- API Route: /analyze-aircraft ---
782 if (request.method === "POST" && new URL(request.url).pathname === "/analyze-aircraft") {
783 try {
784 // Check for OpenAI API Key in Val Town secrets (Val Town automatically injects process.env)
785 // The library handles finding the key from secrets/env vars.
786
899`;
900
901 // --- Call OpenAI API ---
902 const response = await openai.chat.completions.create({
903 model: modelChoice,
994 <meta name="viewport" content="width=device-width, initial-scale=1.0">
995 <meta charset="UTF-8">
996 <link rel="preconnect" href="https://fonts.googleapis.com">
997 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
998 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Orbitron:wght@400;700&display=swap" rel="stylesheet">
999 <style>
1000 /* --- Base & Analyzer Styles --- */

api_ianmenethil_com74 file matches

@ianmenethil•Updated 52 mins ago

readback-api

@tr3ntg•Updated 15 hours ago
API for readback.
apiry
snartapi