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/%22https:/www.reddeeradvocate.com/news/educator-with-a-vision-7034417/%22$%7Bad.imageUrl%7D//%22https:/fonts.gstatic.com/%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 25507 results for "api"(2595ms)

last-login-demo-1index.tsx4 matches

@stevekrouseโ€ขUpdated 19 mins ago
52 try {
53 setLoading(true);
54 const response = await fetch('/api/threads');
55 if (response.ok) {
56 const data = await response.json();
66 const fetchMessages = async (threadId: number) => {
67 try {
68 const response = await fetch(`/api/threads/${threadId}/messages`);
69 if (response.ok) {
70 const data = await response.json();
84
85 try {
86 const response = await fetch(`/api/threads/${selectedThreadId}/messages`, {
87 method: 'POST',
88 headers: {
121 try {
122 setLoading(true);
123 const response = await fetch('/api/threads', {
124 method: 'POST',
125 headers: {

last-login-demo-1README.md9 matches

@stevekrouseโ€ขUpdated 25 mins ago
15```
16โ”œโ”€โ”€ backend/
17โ”‚ โ””โ”€โ”€ index.ts # Main Hono server with API routes
18โ”œโ”€โ”€ frontend/
19โ”‚ โ”œโ”€โ”€ index.html # Main HTML template
27- โœ… Hono app with LastLogin authentication
28- โœ… SQLite schema for threads and messages
29- โœ… Basic API endpoints for threads CRUD
30- โœ… Static file serving for React frontend
31
40- โœ… Chat message display with user/assistant styling
41- โœ… Message input with textarea and send button
42- โœ… OpenAI API integration (GPT-4o-mini)
43- โœ… Real-time message updates
44- โœ… Loading states and typing indicators
45- โœ… Conversation history context
46
47## API Endpoints
48
49- `GET /` - Main React app
50- `GET /api/threads` - List user's threads
51- `POST /api/threads` - Create new thread
52- `GET /api/threads/:id/messages` - Get messages for thread
53- `POST /api/threads/:id/messages` - Send message and get AI response
54
55## Database Schema
67
68- `/debug` - Check authentication status
69- `/api/test-create-thread` - Create a test thread (when logged in)

last-login-demo-1index.ts7 matches

@stevekrouseโ€ขUpdated 27 mins ago
76});
77
78// API Routes for threads
79app.get("/api/threads", async (c) => {
80 const email = c.req.header('X-LastLogin-Email');
81 if (!email) {
92
93// Test route to create a thread
94app.get("/api/test-create-thread", async (c) => {
95 const email = c.req.header('X-LastLogin-Email');
96 if (!email) {
106 message: "Thread created",
107 threadId: result.lastInsertRowId,
108 redirect: "/api/threads"
109 });
110});
127
128// Create new thread
129app.post("/api/threads", async (c) => {
130 const email = c.req.header('X-LastLogin-Email');
131 if (!email) {
151
152// Get messages for a thread
153app.get("/api/threads/:threadId/messages", async (c) => {
154 const email = c.req.header('X-LastLogin-Email');
155 if (!email) {
178
179// Send a message and get OpenAI response
180app.post("/api/threads/:threadId/messages", async (c) => {
181 const email = c.req.header('X-LastLogin-Email');
182 if (!email) {

ReactiveNotesREADME.md1 match

@jsonโ€ขUpdated 40 mins ago
8- [theme](https://github.com/vadimdemedes/thememirror/tree/main/source/themes)
9
10## API
11
12You can access the code using the `code` property:
mcp-registry

mcp-registryREADME.md4 matches

@cameronpakโ€ขUpdated 1 hour 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 1 hour 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 5 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 5 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 5 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 6 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]);

PixelPixelApiMonitor1 file match

@selfire1โ€ขUpdated 17 hours ago
Regularly polls the API and messages on an error.

weatherApp1 file match

@dcm31โ€ขUpdated 1 day ago
A simple weather app with dropdown cities using Open-Meteo API
fapian
<("<) <(")> (>")>
Kapil01