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/$1?q=api&page=2&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 18432 results for "api"(1183ms)

HAPI7 file matches

@dIgitalfulus•Updated 1 week ago

HAPI-01

@dIgitalfulus•Updated 1 week ago

Schedule

@Ozy•Updated 1 week ago
Schedule_api

googleGeminiAPI2 file matches

@michaelwschultz•Updated 1 week ago

HN-fetch-call2 file matches

@ImGqb•Updated 1 week ago
fetch HackerNews by API

token-server1 file match

@kwhinnery_openai•Updated 1 week ago
Mint tokens to use with the OpenAI Realtime API for WebRTC

book-lookup-notion6 file matches

@nucky•Updated 2 weeks ago
use google book api to look up bibliographic metadata elements

openai_api_project_Pauline2 file matches

@Paulineseemann•Updated 2 weeks ago

youtube-transcript-api

@lolocoo•Updated 2 weeks ago

Wait1 file match

@romj•Updated 2 weeks ago
A simple API endpoint that waits for a specified duration

agent-chatindex.ts12 matches

@abrinz•Updated 47 mins ago
12app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
13
14// Add your API routes here
15// app.get("/api/data", c => c.json({ hello: "world" }));
16
17// Chat API endpoint
18app.post("/api/chat", async (c) => {
19 const { messages } = await c.req.json();
20
21 try {
22 // Call your agent API
23 const requestBody = {
24 messages: messages,
30 };
31
32 // Add authorization header if API key is available
33 const apiKey = Deno.env.get("AGENT_API_KEY")?.trim();
34
35 if (apiKey) {
36 headers["Authorization"] = `Bearer ${apiKey}`;
37 }
38
50 if (!response.ok) {
51 const errorText = await response.text();
52 console.error(`Agent API error: ${response.status} - ${errorText}`);
53 throw new Error(`Agent API error: ${response.status} - ${errorText}`);
54 }
55
219 });
220 } catch (error) {
221 console.error("Chat API error:", error);
222
223 // Return error as streaming response

agent-chatChat.tsx1 match

@abrinz•Updated 1 hour ago
5export function Chat() {
6 const { messages, input, handleInputChange, handleSubmit, isLoading, setInput } = useChat({
7 api: "/api/chat",
8 streamProtocol: "data",
9 onError: (error) => {
apiry
snartapi