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=561&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 11896 results for "api"(933ms)

replicate_starterindex.ts1 match

@replicateUpdated 2 months ago
16 const { prompt } = await c.req.json();
17
18 const replicate = new Replicate({ auth: Deno.env.get("REPLICATE_API_TOKEN") });
19 const model = "black-forest-labs/flux-schnell";
20 const output = await replicate.run(model, {

BraintrustSDKtutorial7 matches

@tkneislyUpdated 2 months ago
5export default async function handler() {
6 const result = {
7 apiKeyStatus: null,
8 evalStarted: false,
9 evalComplete: false,
13
14 try {
15 // Check API key
16 const apiKey = Deno.env.get("BRAINTRUST_API_KEY");
17 if (!apiKey) {
18 throw new Error("Add BRAINTRUST_API_KEY to your environment variables");
19 }
20 result.apiKeyStatus = "found";
21 console.log("API Key status:", result.apiKeyStatus);
22
23 // Start evaluation

BraintrustSDKREADME.md2 matches

@tkneislyUpdated 2 months ago
12
13- Click `Fork` on this val
14- Get your Braintrust API key at https://www.braintrust.dev/app/settings?subroute=api-keys
15- Add it to your project `Environment Variables` (on the left side bar of this project) as `BRAINTRUST_API_KEY`
16- Click `Run` on the `tutorial` val

ecstaticPeachRatmain.tsx2 matches

@shouserUpdated 2 months ago
1const respNoAuth = await fetch(
2 "https://api.val.town/v1/projects/0e843a78-e4c6-11ef-9b31-e6cdfca9ef9f/branches?limit=100",
3);
4console.log(await respNoAuth.json());
5
6const respAuthed = await fetch(
7 "https://api.val.town/v1/projects/0e843a78-e4c6-11ef-9b31-e6cdfca9ef9f/branches?limit=100",
8 { headers: { "Authorization": `Bearer ${Deno.env.get("valtown")}` } },
9);

fiberplaneHonoZodStarterapi.ts7 matches

@fiberplaneUpdated 2 months ago
1import { OpenAPIHono } from "https://esm.sh/@hono/zod-openapi@0.18.4";
2import { createRoute } from "https://esm.sh/@hono/zod-openapi@0.18.4";
3import { z } from "https://esm.sh/@hono/zod-openapi@0.18.4";
4import { HTTPException } from "https://esm.sh/hono@4.7.0/http-exception";
5import { ErrorSchema } from "../schema.ts";
6import type { AppType } from "../types.ts";
7
8export const superProtectedApi = new OpenAPIHono<AppType>();
9
10// Define a mock route that is protected with bearer auth
34
35// Mock middleware that just returns 401 if there's no authorization header for the request
36superProtectedApi.use(async (c, next) => {
37 if (!c.req.header("authorization")) {
38 return c.json({ error: "Unauthorized" }, 401);
41});
42
43superProtectedApi.openapi(superSecretSecretsRoute, c => {
44 return c.json({ secrets: ["cold harbor", "other secret idk"] }, 200);
45});
46
47superProtectedApi.openAPIRegistry.registerComponent("securitySchemes", "Bearer", {
48 type: "http",
49 scheme: "bearer",

orbiterHealthconfig.json1 match

@stevedylandevUpdated 2 months ago
3 "https://orbiter.host",
4 "https://app.orbiter.host",
5 "https://api.orbiter.host/health"
6 ]
7}

chatgptmain.tsx5 matches

@mtzUpdated 2 months ago
112 }
113
114 // Direct API chat endpoint via query parameters
115 if (searchParams.has("chat")) {
116 try {
188 <html>
189 <head>
190 <title>🤖 Free AI API Service</title>
191 <meta name="viewport" content="width=device-width, initial-scale=1">
192 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
193 <style>
194 :root {
299 <div class="container">
300 <div class="header">
301 <h1>🤖 Free AI API Service <span class="free-badge">100% Free</span></h1>
302 <p>Instant AI assistance across multiple advanced models. No API keys, no cost!</p>
303 </div>
304
189 <title>Solar Supply Chain Dashboard</title>
190 <meta name="viewport" content="width=device-width, initial-scale=1.0">
191 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
192 <style>${css}</style>
193 </head>

cerebras_coderstarter-prompts.js1 match

@AsadouraUpdated 2 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>",

cerebras_coderREADME.md2 matches

@AsadouraUpdated 2 months 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`

social_data_api_project3 file matches

@tsuchi_yaUpdated 1 day ago

simple-scrabble-api1 file match

@bryUpdated 1 day 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