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=3&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"(614ms)

createemailapiv22 file matches

@souravvmishraUpdated 2 weeks ago

waec_api6 file matches

@seyistryUpdated 2 weeks ago

new-val-api-demo

@shouserUpdated 2 weeks ago
This is an example of using the API to create a val.

groq-api2 file matches

@cameronpakUpdated 2 weeks ago

create-val-api-demo1 file match

@shouserUpdated 2 weeks ago

new-val-api-demo

@shouserUpdated 2 weeks ago
This is an example of using the API to create a val.

vapi-minutes-db1 file match

@henrywilliamsUpdated 3 weeks ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 3 weeks ago

social_data6 file matches

@stevekrouseUpdated 3 weeks ago
Service for getting Twitter 𝕏 data without Twitter's API

social_data_api_project3 file matches

@tsuchi_yaUpdated 4 weeks ago

agent-chatindex.ts12 matches

@abrinzUpdated 51 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

@abrinzUpdated 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