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/%22script.js//%22https:/codex.so/%22?q=api&page=1&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 25503 results for "api"(1699ms)

mcp-registry

mcp-registryREADME.md4 matches

@cameronpak•Updated 21 mins ago
9- Val.Town & Deno
10- Hono server
11- Official MCP Registry API
12- Webawesome components and icons
13
18This project is available on [Val.Town](https://www.val.town/x/cameronpak/mcp-registry) and can be accessed at: `https://cameronpak-mcp-registry.web.val.run`
19
20## API Proxy
21
22This server acts as a proxy for the official MCP Registry API, allowing you to access registry endpoints through this server. All requests are forwarded to `https://registry.modelcontextprotocol.io`.
23
24- `GET /v0/servers` - [List Servers](https://registry.modelcontextprotocol.io/docs#/operations/list-servers)
27- `GET /v0/health` - Health check
28- `GET /v0/ping` - Ping the registry
29- `GET /docs` - Redirect to official API documentation
30
31## Additional MCP Registries

nabanhotelmain.ts2 matches

@francisnkotanyi•Updated 38 mins ago
6<meta name="description" content="NABAN HOTEL — comfortable rooms, excellent service and minutes from the new airport under construction." />
7<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
8<link rel="preconnect" href="https://fonts.googleapis.com">
9<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap" rel="stylesheet">
11<style>body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; }</n/style>
12<style>

manifoldHttpmain.ts19 matches

@dcm31•Updated 4 hours ago
6 const [url, setUrl] = useState("");
7 const [result, setResult] = useState<any>(null);
8 const [apiKey, setApiKey] = useState("");
9 const [betAmount, setBetAmount] = useState(0);
10 const [status, setStatus] = useState<string | null>(null);
11
12 useEffect(() => {
13 const storedKey = localStorage.getItem("manifoldApiKey");
14 if (storedKey) setApiKey(storedKey);
15 }, []);
16
17 function saveKey() {
18 localStorage.setItem("manifoldApiKey", apiKey);
19 alert("API key saved locally");
20 }
21
34
35 async function handleBetTest() {
36 if (!result || !apiKey || betAmount <= 0) return;
37 setStatus("Placing test bet on first option...");
38
42 body: JSON.stringify({
43 url,
44 apiKey,
45 amount: betAmount
46 })
56
57 <div className="mb-4">
58 <h2 className="font-semibold mb-2">API Key</h2>
59 <input
60 type="password"
61 value={apiKey}
62 onChange={(e) => setApiKey(e.target.value)}
63 placeholder="Enter Manifold API key"
64 className="border p-2 rounded w-full mb-2"
65 />
133 const slug = parts.pop() || parts.pop();
134
135 const apiUrl = `https://manifold.markets/api/v0/slug/${slug}`;
136 const res = await fetch(apiUrl);
137 if (!res.ok) return new Response(`Failed to fetch market: ${res.statusText}`, { status: 500 });
138
152
153 if (pathname === "/betTest" && req.method === "POST") {
154 const { url, apiKey, amount } = await req.json();
155 if (!url || !apiKey || !amount) return new Response("Missing parameters", { status: 400 });
156
157 const parts = url.split("/");
158 const slug = parts.pop() || parts.pop();
159
160 const apiUrl = `https://manifold.markets/api/v0/slug/${slug}`;
161 const res = await fetch(apiUrl);
162 if (!res.ok) return new Response(`Failed to fetch market: ${res.statusText}`, { status: 500 });
163
169 const first = data.answers.sort((a: any, b: any) => b.probability - a.probability)[0];
170
171 const betRes = await fetch("https://manifold.markets/api/v0/bet", {
172 method: "POST",
173 headers: {
174 "content-type": "application/json",
175 "Authorization": `Key ${apiKey}`,
176 },
177 body: JSON.stringify({

manifoldSummain.ts2 matches

@dcm31•Updated 4 hours ago
4 const slug = parts.pop() || parts.pop(); // handle trailing slash
5
6 const apiUrl = `https://manifold.markets/api/v0/slug/${slug}`;
7 const res = await fetch(apiUrl);
8 if (!res.ok) throw new Error(`Failed to fetch market: ${res.statusText}`);
9 const data = await res.json();

gatemain.ts2 matches

@know•Updated 4 hours ago
185 <meta name="viewport" content="width=device-width, initial-scale=1.0">
186 <title>Principia</title>
187 <link rel="preconnect" href="https://fonts.googleapis.com">
188 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
189 <link href="https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700&family=Roboto+Mono:wght@300;400&display=swap" rel="stylesheet">
190 <style>
191 :root {

h6-val-summary.ts3 matches

@werewolf006•Updated 4 hours ago
18 SUM(num_images) as total_images
19 FROM ${USAGE_TABLE}
20 WHERE val_id = ? AND our_api_token = 1
21 GROUP BY val_id
22 `, [valId]);
34 FROM ${INFERENCE_CALLS_TABLE} i
35 JOIN ${USAGE_TABLE} u ON i.usage_id = u.id
36 WHERE u.val_id = ? AND u.our_api_token = 1
37 GROUP BY u.val_id
38 `, [valId]);
41 const requestsResult = await sqlite.execute(`
42 SELECT * FROM ${USAGE_TABLE}
43 WHERE val_id = ? AND our_api_token = 1
44 ORDER BY timestamp DESC
45 `, [valId]);

h6-val-detail.ts1 match

@werewolf006•Updated 4 hours ago
18 finish_reason?: string;
19 num_images?: number;
20 our_api_token: boolean;
21}
22

h6-useUser.tsx1 match

@werewolf006•Updated 4 hours ago
1import { useState, useEffect } from "react";
2
3const USER_ENDPOINT = "/api/user";
4
5export function useUser() {

h6-user-summary.ts2 matches

@werewolf006•Updated 4 hours ago
20 SUM(num_images) as total_images
21 FROM ${USAGE_TABLE}
22 WHERE our_api_token = 1
23 `;
24
41 FROM ${INFERENCE_CALLS_TABLE} i
42 JOIN ${USAGE_TABLE} u ON i.usage_id = u.id
43 WHERE u.our_api_token = 1
44 `;
45

h6-user-detail.ts2 matches

@werewolf006•Updated 4 hours ago
1import { renderLayout } from "./layout.ts";
2import { formatNumber, formatPrice, formatDate, formatBoolean } from "../utils/formatters.ts";
3import { CreditAddition } from "../api/credit-additions.ts";
4
5interface UserSummaryRow {
33 finish_reason?: string;
34 num_images?: number;
35 our_api_token: boolean;
36}
37

PixelPixelApiMonitor1 file match

@selfire1•Updated 16 hours ago
Regularly polls the API and messages on an error.

weatherApp1 file match

@dcm31•Updated 22 hours ago
A simple weather app with dropdown cities using Open-Meteo API
fapian
<("<) <(")> (>")>
Kapil01