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=1160&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 17623 results for "api"(1570ms)

cerebras_coderindex1 match

@Priyanshu_23Updated 3 months 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_codergenerate-code1 match

@Priyanshu_23Updated 3 months 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: [

blogIdeaGeneratorAppmain.tsx1 match

@melissanfUpdated 3 months ago
274
275export default async function server(request: Request): Promise<Response> {
276 // Handle API and shared content routes
277 if (request.method === "POST") {
278 const { OpenAI } = await import("https://esm.town/v/std/openai");

blogIdeaGeneratorAppREADME.md1 match

@melissanfUpdated 3 months ago
15### Tech Stack
16* Townie AI – AI-based automation
17* OpenAI API – For generating blog content
18* Built-in Databases – To store and retrieve topics (if needed)
19* How to Deploy & Share

productiveIndigoJayREADME.md1 match

@melissanfUpdated 3 months ago
25## **Tech Stack**
26- **Townie AI** – AI-based automation
27- **OpenAI API** – For generating blog content
28- **Built-in Databases** – To store and retrieve topics (if needed)
29

saunaTemperatureDashboardmain.tsx1 match

@jhillerUpdated 3 months ago
369 <title>Sauna Temperature Dashboard</title>
370 <meta name="viewport" content="width=device-width, initial-scale=1">
371 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
372 <style>
373 body { margin: 0; background-color: #FFF3E0; }

priyanshCartoonAppmain.tsx7 matches

@PriyanshUpdated 3 months ago
9 description: "एक मजेदार कार्टून कहानी",
10 thumbnailUrl: "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='120'><rect width='100%' height='100%' fill='%23f0f0f0'/><text x='50%' y='50%' text-anchor='middle' alignment-baseline='middle' font-size='20' fill='%23333'>🎬 वीडियो 1</text></svg>",
11 videoUrl: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
12 },
13 {
16 description: "दोस्ती की एक मीठी कहानी",
17 thumbnailUrl: "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='120'><rect width='100%' height='100%' fill='%23e0e0e0'/><text x='50%' y='50%' text-anchor='middle' alignment-baseline='middle' font-size='20' fill='%23333'>🎥 वीडियो 2</text></svg>",
18 videoUrl: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4"
19 },
20 {
23 description: "AI की रचना का रोमांचक सफर",
24 thumbnailUrl: "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='120'><rect width='100%' height='100%' fill='%23e0f0ff'/><text x='50%' y='50%' text-anchor='middle' alignment-baseline='middle' font-size='20' fill='%23333'>🤖 AI वीडियो</text></svg>",
25 videoUrl: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4"
26 },
27 {
30 description: "प्रियांश की रहस्यमय जंगल यात्रा",
31 thumbnailUrl: "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='120'><rect width='100%' height='100%' fill='%23e0ffb0'/><text x='50%' y='50%' text-anchor='middle' alignment-baseline='middle' font-size='20' fill='%23333'>🌳 जंगल वीडियो</text></svg>",
32 videoUrl: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/SubaruImpreza.mp4"
33 },
34 {
37 description: "प्रियांश का रोबोट दोस्त और अंतरिक्ष यात्रा",
38 thumbnailUrl: "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='120'><rect width='100%' height='100%' fill='%23b0e0ff'/><text x='50%' y='50%' text-anchor='middle' alignment-baseline='middle' font-size='20' fill='%23333'>🚀 अंतरिक्ष वीडियो</text></svg>",
39 videoUrl: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/WeAreGoingOnBullrun.mp4"
40 },
41 {
44 description: "प्रियांश की अद्भुत समुद्री यात्रा",
45 thumbnailUrl: "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='120'><rect width='100%' height='100%' fill='%23b0ffdc'/><text x='50%' y='50%' text-anchor='middle' alignment-baseline='middle' font-size='20' fill='%23333'>🌊 समुद्र वीडियो</text></svg>",
46 videoUrl: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4"
47 },
48 {
51 description: "प्रियांश के परिवार के साथ त्योहार की खुशियां",
52 thumbnailUrl: "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='120'><rect width='100%' height='100%' fill='%23ffd0b0'/><text x='50%' y='50%' text-anchor='middle' alignment-baseline='middle' font-size='20' fill='%23333'>🎉 त्योहार वीडियो</text></svg>",
53 videoUrl: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4"
54 },
55 {

priyanshSocialMediaAppmain.tsx1 match

@PriyanshUpdated 3 months ago
222 );
223
224 // Use OpenAI Vision API
225 const visionResponse = await openai.chat.completions.create({
226 model: "gpt-4-vision-preview",

whoIsHiringmain.tsx4 matches

@teachai1Updated 3 months ago
63 const fetchStories = async () => {
64 try {
65 const response = await fetch("/api/stories");
66 if (!response.ok) throw new Error("Failed to fetch dates");
67 const data = await response.json();
77 try {
78 dispatch({ type: "loading", value: true });
79 const response = await fetch(`/api/comments?query=${encodeURIComponent(query)}&story=${story}&page=${page}`);
80 if (!response.ok) throw new Error("Failed to fetch comments");
81 const data = await response.json();
360export default async function(req: Request): Promise<Response> {
361 const url = new URL(req.url);
362 if (url.pathname === "/api/stories") {
363 const storySearch = await hnSearch({
364 search_by_date: true,
381 }
382
383 if (url.pathname === "/api/comments") {
384 const params = url.searchParams;
385 const query = params.get("query") || "";

cerebras_coderstarter-prompts.js1 match

@rolloutUpdated 3 months ago
11 },
12 {
13 "prompt": "weather dashboard for nyc using open-meteo API for NYC with icons",
14 "title": "Weather App",
15 "code": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>NYC Weather</title>\n <link href=\"https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css\" rel=\"stylesheet\">\n <style>\n .weather-icon {\n font-size: 48px;\n margin-bottom: 16px;\n }\n </style>\n</head>\n<body class=\"h-screen bg-blue-100 flex justify-center items-center p-4\">\n <div class=\"bg-white p-8 rounded-md shadow-md w-full max-w-sm md:p-12 lg:p-16 xl:p-20\">\n <h1 class=\"text-2xl font-bold mb-4 text-center text-blue-500\">NYC Weather</h1>\n <div id=\"weather\" class=\"mb-4 p-4 text-center\">\n <div id=\"temperature\" class=\"text-4xl font-bold mb-4\"></div>\n <div id=\"condition\" class=\"text-xl font-medium mb-4\"></div>\n <div id=\"humidity\" class=\"text-lg font-light mb-2\">Humidity: <span id=\"humidity-value\"></span>%</div>\n <div id=\"wind\" class=\"text-lg font-light mb-2\">Wind: <span id=\"wind-value\"></span> mph</div>\n <i id=\"weather-icon\" class=\"weather-icon text-blue-500\"></i>\n </div>\n </div>\n <p class=\"fixed bottom-0 left-0 right-0 text-center p-4 text-gray-600 md:p-6 lg:p-8 xl:p-10\">\n Built on <a class=\"text-blue-600\" href=\"https://cerebrascoder.com\">Cerebras Coder</a>\n </p>\n\n <script>\n // Sample weather data\n const weatherData = {\n temperature: 75,\n condition: 'Sunny',\n humidity: 60,\n wind: 10,\n icon: 'sun'\n };\n\n document.getElementById('temperature').innerText = `${weatherData.temperature}°F`;\n document.getElementById('condition').innerText = weatherData.condition;\n document.getElementById('humidity-value').innerText = weatherData.humidity;\n document.getElementById('wind-value').innerText = weatherData.wind;\n\n // Map weather icon\n const weatherIcons = {\n 'sun': '&#9728;',\n 'cloud': '&#9728;',\n 'rain': '&#9731;',\n 'snow': '&#9732;'\n };\n\n document.getElementById('weather-icon').innerHTML = weatherIcons[weatherData.icon] || '';\n </script>\n</body>\n</html>",

RandomQuoteAPI

@FreelzyUpdated 1 day ago

HAPI7 file matches

@dIgitalfulusUpdated 1 day ago
Kapil01
apiv1