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/image-url.jpg%20%22Image%20title%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 19720 results for "api"(1503ms)

kebede-and-ben-testApp.tsx2 matches

@bmitchinsonโ€ขUpdated 1 hour ago
16
17 try {
18 const response = await fetch('/api/game', {
19 method: 'POST',
20 headers: {
47 const moveData: MoveRequest = { position };
48
49 const response = await fetch(`/api/game/${game.id}/move`, {
50 method: 'PUT',
51 headers: {

kebede-and-ben-testindex.ts2 matches

@bmitchinsonโ€ขUpdated 1 hour ago
14await runMigrations();
15
16// API routes
17app.route("/api/game", gameRoutes);
18
19// Serve static files

kebede-and-ben-testREADME.md6 matches

@bmitchinsonโ€ขUpdated 1 hour ago
20โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Game queries
21โ”‚ โ””โ”€โ”€ routes/
22โ”‚ โ””โ”€โ”€ game.ts # Game API routes
23โ”œโ”€โ”€ frontend/
24โ”‚ โ”œโ”€โ”€ index.html # Main page
416. Click "New Game" to start over
42
43## API Endpoints
44
45- `GET /api/game/:gameId` - Get game state
46- `POST /api/game` - Create new game
47- `PUT /api/game/:gameId/move` - Make a move
48- `GET /api/games` - List recent games

statuspushover2 matches

@helgeโ€ขUpdated 1 hour ago
5const PUSHOVER_USER_KEY = Deno.env.get("PUSHOVER_USER_KEY");
6
7// token, user, and other opts are as specified at https://pushover.net/api
8export async function pushover({ message, title }) {
9 console.log("Input:", { message, title });
10 console.log("Tokens:", { PUSHOVER_TOKEN, PUSHOVER_USER_KEY }); // Check if env vars are set
11
12 const response = await fetch("https://api.pushover.net/1/messages.json", {
13 method: "POST",
14 headers: {

workingNotWorkingBoardindex.ts1 match

@dcm31โ€ขUpdated 2 hours ago
385
386const css = `
387@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
388
389:root {

slimifygemini.tsx1 match

@affanโ€ขUpdated 2 hours ago
1import { GoogleGenAI, Type } from "npm:@google/genai";
2
3const ai = new GoogleGenAI({ apiKey: "AIzaSyDcuswpF8sAUBVTvrUlnpADXF4gHjTTAxA" });
4
5const _prompt =

workingNotWorkingBoardstyles.css1 match

@dcm31โ€ขUpdated 3 hours ago
1@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
2
3:root {

ChatApp.tsx8 matches

@c15rโ€ขUpdated 3 hours ago
15
16export interface AppConfig {
17 anthropicApiKey: string;
18 mcpServers: MCPServerConfig[];
19 selectedModel: string;
40export default function App() {
41 const [config, setConfig] = useState<AppConfig>({
42 anthropicApiKey: "",
43 mcpServers: [],
44 selectedModel: "claude-3-5-sonnet-20241022",
55 // Load config from localStorage on mount
56 useEffect(() => {
57 const savedApiKey = localStorage.getItem("anthropic_api_key");
58 const savedMcpServers = localStorage.getItem("mcp_servers");
59 const savedMessages = localStorage.getItem("chat_messages");
64 let mcpServers = savedMcpServers ? JSON.parse(savedMcpServers) : DEFAULT_MCP_SERVERS;
65 setConfig({
66 anthropicApiKey: savedApiKey || "",
67 mcpServers: mcpServers,
68 selectedModel: savedModel || "claude-3-5-sonnet-20241022",
81 }
82
83 // Show settings if no API key is configured
84 if (!savedApiKey) {
85 setShowSettings(true);
86 }
89 // Save config to localStorage when it changes
90 useEffect(() => {
91 if (config.anthropicApiKey) {
92 localStorage.setItem("anthropic_api_key", config.anthropicApiKey);
93 }
94 localStorage.setItem("mcp_servers", config.mcpServers?.length ? JSON.stringify(config.mcpServers) : "");

ChatHTMLRenderer.tsx23 matches

@c15rโ€ขUpdated 3 hours ago
9}
10
11interface MCPContextAPI {
12 // Tool operations
13 listTools: () => Promise<any[]>;
37 * - Renders HTML in a secure iframe
38 * - Provides fullscreen enter/exit affordances
39 * - Exposes MCP context API to iframe content
40 * - Handles iframe communication via postMessage
41 */
47 console.log("[MCP/Browser Renderer] HTMLRenderer: Rendering HTML:", { mcpClients });
48
49 // Create MCP context API that will be exposed to iframe
50 const createMCPContext = useCallback((): MCPContextAPI => {
51 const findClientByName = (serverName: string) => {
52 console.log("[MCP/Browser Renderer] Finding client by name:", serverName, mcpClients);
177 const { type, id, method, args } = event.data;
178
179 if (type !== "mcp-api-call") {
180 return;
181 }
186
187 if (typeof methodFunc !== "function") {
188 throw new Error(`Unknown MCP API method: ${method}`);
189 }
190
192
193 iframe.contentWindow?.postMessage({
194 type: "mcp-api-response",
195 id,
196 success: true,
199 } catch (error) {
200 iframe.contentWindow?.postMessage({
201 type: "mcp-api-response",
202 id,
203 success: false,
222 </script>
223 <script>
224 // MCP Context API for iframe content
225 window.mcpContext = {
226 // Async wrapper for postMessage communication
227 async callAPI(method, ...args) {
228 return new Promise((resolve, reject) => {
229 const id = Math.random().toString(36).substr(2, 9);
230
231 const handleResponse = (event) => {
232 if (event.data.type === 'mcp-api-response' && event.data.id === id) {
233 window.removeEventListener('message', handleResponse);
234 if (event.data.success) {
243
244 window.parent.postMessage({
245 type: 'mcp-api-call',
246 id,
247 method,
252 setTimeout(() => {
253 window.removeEventListener('message', handleResponse);
254 reject(new Error('MCP API call timeout'));
255 }, 30000);
256 });
258
259 // Convenience methods
260 async listTools() { return this.callAPI('listTools'); },
261 async callTool(serverName, toolName, args) { return this.callAPI('callTool', serverName, toolName, args); },
262 async listPrompts() { return this.callAPI('listPrompts'); },
263 async getPrompt(serverName, promptName, args) { return this.callAPI('getPrompt', serverName, promptName, args); },
264 async listResources() { return this.callAPI('listResources'); },
265 async readResource(serverName, uri) { return this.callAPI('readResource', serverName, uri); },
266 log(level, message, data) { this.callAPI('log', level, message, data); },
267 requestFullscreen() { this.callAPI('requestFullscreen'); },
268 exitFullscreen() { this.callAPI('exitFullscreen'); },
269 async isFullscreen() { return this.callAPI('isFullscreen'); }
270 };
271

stravachatsendDailyBrief.ts8 matches

@katzenjโ€ขUpdated 3 hours ago
97
98export async function sendDailyBriefing(chatId?: string, today?: DateTime) {
99 // Get API keys from environment
100 const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
101 const telegramToken = Deno.env.get("TELEGRAM_TOKEN");
102
106 }
107
108 if (!apiKey) {
109 console.error("Anthropic API key is not configured.");
110 return;
111 }
122
123 // Initialize Anthropic client
124 const anthropic = new Anthropic({ apiKey });
125
126 // Initialize Telegram bot
162
163 // disabled title for now, it seemes unnecessary...
164 // await bot.api.sendMessage(chatId, `*${title}*`, { parse_mode: "Markdown" });
165
166 // Then send the main content
169
170 if (content.length <= MAX_LENGTH) {
171 await bot.api.sendMessage(chatId, content, { parse_mode: "Markdown" });
172 // Store the briefing in chat history
173 await storeChatMessage(
198 // Send each chunk as a separate message and store in chat history
199 for (const chunk of chunks) {
200 await bot.api.sendMessage(chatId, chunk, { parse_mode: "Markdown" });
201 // Store each chunk in chat history
202 await storeChatMessage(
Plantfo

Plantfo8 file matches

@Lladโ€ขUpdated 8 hours ago
API for AI plant info

scrapeCraigslistAPI1 file match

@shapedlinesโ€ขUpdated 21 hours ago
apiry
snartapi