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/$%7Burl%7D?q=api&page=9&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 19668 results for "api"(1498ms)

untitled-5696utils.ts3 matches

@tallesjp•Updated 1 day ago
5 // Estimar duração baseada no tipo e quantidade de steps
6 const baseDuration = steps.length * 2; // 2 segundos por step base
7 const complexSteps = steps.filter(s => ["api_call", "database_operation"].includes(s.action)).length;
8 return baseDuration + (complexSteps * 5); // +5 segundos para steps complexos
9}
22 steps.forEach(step => {
23 switch (step.action) {
24 case "make_api_call":
25 permissions.add("network_access");
26 break;
44
45 steps.forEach(step => {
46 if (step.action === "make_api_call") {
47 dependencies.add("http_client");
48 }

untitled-5696api.ts1 match

@tallesjp•Updated 1 day ago
1// api.ts
2
3import { convertFlowchartToAI } from './aiConverter';

autonomous-valdemo.tsx5 matches

@tengis•Updated 1 day ago
22 objective = formData.get("objective")?.toString() || objective;
23
24 // Continue with API call using the submitted objective
25 } else {
26 return new Response("Unsupported content type", { status: 415 });
27 }
28
29 // Make API call with the objective from the form
30 const requestBody = {
31 messages: [
40 headers: {
41 "Content-Type": "application/json",
42 "Authorization": `Bearer ${Deno.env.get("AGENT_API_KEY")}`,
43 },
44 body: JSON.stringify(requestBody),
50 }
51
52 // Get the API response data
53 const responseData = await response.json();
54 console.log("API Response:", responseData);
55
56 // Return HTML with the results

autonomous-valtools.tsx4 matches

@tengis•Updated 1 day ago
77 }),
78 execute: async ({ query }) => {
79 const apiKey = Deno.env.get("EXA_API_KEY");
80 const exa = new Exa(apiKey);
81 const result = await exa.searchAndContents(query, {
82 text: true,
100 }),
101 execute: async ({ url }) => {
102 const apiKey = Deno.env.get("EXA_API_KEY");
103 const exa = new Exa(apiKey);
104 const result = await exa.getContents([url], { text: true });
105 return {

autonomous-valREADME.md9 matches

@tengis•Updated 1 day ago
1# Autonomous Val
2This project demonstrates how to build autonomous agents on Val Town that can be triggered by API calls, cron jobs, etc.
3
4![Screenshot 2025-05-29 at 8.03.54 PM.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/8d53ae11-7cc7-415d-9a2d-edd9c66c5500/public)
8
9Configure the following variables in your environment:
10- `AGENT_API_KEY` (This is a secure token that you choose to secure the agent.tsx POST endpoint)
11- `OPENAI_API_KEY` (An OpenAI API Key)
12- `EXA_API_KEY` (Optional, though needed if you use the web search tool)
13
14## Usage
15Use `demo.tsx` to send objectives to your agent.
16
17### API Usage
18To use the API from another client, you can POST authenticated requests to the agent.tsx endpoint:
19
20```javascript
30 headers: {
31 "Content-Type": "application/json",
32 "Authorization": `Bearer ${Deno.env.get("AGENT_API_KEY")}`,
33 },
34 body: JSON.stringify(requestBody),
37
38### Streaming Chat
39The API will also work with streaming chat front ends based on the Vercel AI SDK's useChat hook.
40
41You just need to pass `streamResults: true` in your API POST request.
42
43## Using Other Models

autonomous-valdiagram.tsx1 match

@tengis•Updated 1 day ago
5 linkStyle default stroke:#aaaaaa,stroke-width:1.5px
6
7 API[API] <--> Agent
8
9 subgraph "Agent Runtime"

autonomous-valagent.tsx2 matches

@tengis•Updated 1 day ago
17
18export default async function POST(req: Request) {
19 if (req.headers.get("Authorization") !== `Bearer ${Deno.env.get("AGENT_API_KEY")}`) {
20 return new Response("Unauthorized", { status: 401 });
21 }
34 const maxSteps = 10;
35
36 const model = Deno.env.get("ANTHROPIC_API_KEY") ? anthropic("claude-3-7-sonnet-latest") : openai("gpt-4.1");
37
38 const options = {

axadasmain.tsx7 matches

@tallesjp•Updated 1 day ago
3// Permite criar fluxogramas de arrastar e soltar e converter para instruções de IA
4
5import { convertToAI, exportJSON, importJSON, loadFlowchart, saveFlowchart } from "./apiHandlers.ts";
6import { getMainHTML } from "./frontend/mainHtml.ts"; // Vamos criar este arquivo para o HTML
7
10 const path = url.pathname;
11
12 // Roteamento da API
13 if (path === "/api/save-flowchart" && req.method === "POST") {
14 return await saveFlowchart(req);
15 }
16
17 if (path === "/api/convert-to-ai" && req.method === "POST") {
18 return await convertToAI(req);
19 }
20
21 if (path === "/api/load-flowchart" && req.method === "GET") {
22 return await loadFlowchart(req);
23 }
24
25 if (path === "/api/export-json" && req.method === "POST") {
26 return await exportJSON(req);
27 }
28
29 if (path === "/api/import-json" && req.method === "POST") {
30 return await importJSON(req);
31 }

axadasindex.ts10 matches

@tallesjp•Updated 1 day ago
65 "input": "Entrada",
66 "output": "Saída",
67 "api": "API Call",
68 "end": "Fim",
69 "database": "Banco de Dados", // Adicionado
98 { value: "file", label: "Arquivo" },
99 { value: "notification", label: "Notificação" },
100 { value: "api_response", label: "Resposta API" },
101 ],
102 "api": [
103 { value: "rest", label: "REST API" },
104 { value: "graphql", label: "GraphQL" },
105 { value: "webhook", label: "Webhook" },
233(window as any).showStatus = showStatus;
234(window as any).addNode = addNode; // Será definida mais abaixo
235(window as any).saveFlowchart = saveFlowchartGlobal; // Funções de API serão wrappers
236(window as any).convertToAI = convertToAIGlobal;
237(window as any).exportJSON = exportJSONGlobal;
243(window as any).saveNodeEdit = saveNodeEdit;
244
245// === Funções Globais para o HTML (wrappers para as chamadas de API) ===
246// Estas funções farão as chamadas para o backend via fetch
247
253
254 try {
255 const response = await fetch("/api/save-flowchart", {
256 method: "POST",
257 headers: { "Content-Type": "application/json" },
277 try {
278 showStatus("Convertendo fluxograma...");
279 const response = await fetch("/api/convert-to-ai", {
280 method: "POST",
281 headers: { "Content-Type": "application/json" },
301
302 try {
303 const response = await fetch("/api/export-json", {
304 method: "POST",
305 headers: { "Content-Type": "application/json" },
332 const jsonData = JSON.parse(e.target!.result as string);
333
334 const response = await fetch("/api/import-json", {
335 method: "POST",
336 headers: { "Content-Type": "application/json" },

axadasstyles.ts1 match

@tallesjp•Updated 1 day ago
326 }
327
328 .flowchart-node.api {
329 background: linear-gradient(135deg, rgba(111, 66, 193, 0.4), rgba(111, 66, 193, 0.2));
330 border-color: rgba(111, 66, 193, 0.6);
Plantfo

Plantfo8 file matches

@Llad•Updated 1 hour ago
API for AI plant info

scrapeCraigslistAPI1 file match

@shapedlines•Updated 14 hours ago
apiry
snartapi