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=14&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"(1931ms)

untitled-5696aiConverter.ts4 matches

@tallesjp•Updated 1 day ago
31 'input': 'user_input',
32 'output': 'system_output',
33 'api': 'api_call',
34 'database': 'data_operation',
35 'loop': 'iteration'
115 break;
116
117 case 'api':
118 step.action = "make_api_call";
119 step.parameters = {
120 url: node.url || "",
200 },
201 {
202 type: "api_error",
203 action: "log_and_continue",
204 fallback_step: "error_notification"

untitled-5696client.ts4 matches

@tallesjp•Updated 1 day ago
411 <button class="glass-button" data-node-type="input">šŸ“ Entrada</button>
412 <button class="glass-button" data-node-type="output">šŸ“¤ SaĆ­da</button>
413 <button class="glass-button" data-node-type="api">🌐 API</button>
414 <button class="glass-button" data-node-type="end">ā¹ļø Fim</button>
415 <button class="glass-button" id="saveFlowchart">šŸ’¾ Salvar</button>
464 <li><strong>šŸ“ Entrada:</strong> Coleta de dados ou informaƧƵes.</li>
465 <li><strong>šŸ“¤ SaĆ­da:</strong> Exibição de resultados ou informaƧƵes.</li>
466 <li><strong>🌐 API:</strong> Chamada a uma API externa.</li>
467 <li><strong>ā¹ļø Fim:</strong> O ponto final do seu fluxograma.</li>
468 </ul>
506 decision: { label: "DecisĆ£o", icon: "ā“", color: "#FFC107", subtypes: ["Booleano", "Comparação", "Intervalo", "PadrĆ£o"] },
507 input: { label: "Entrada", icon: "šŸ“", color: "#9C27B0", subtypes: ["Texto", "NĆŗmero", "Arquivo", "Seleção"] },
508 output: { label: "SaĆ­da", icon: "šŸ“¤", color: "#FF5722", subtypes: ["Exibir", "Arquivo", "Notificação", "Resposta API"] },
509 api: { label: "API", icon: "🌐", color: "#673AB7", subtypes: ["REST API", "GraphQL", "Webhook", "Database"] },
510 end: { label: "Fim", icon: "ā¹ļø", color: "#F4436", subtypes: [] },
511 };

untitled-5696main.ts7 matches

@tallesjp•Updated 1 day ago
1// main.ts
2
3import { saveFlowchart, convertToAI, loadFlowchart, exportJSON, importJSON } from './api';
4import { getMainHTML } from './htmlTemplate';
5
8 const path = url.pathname;
9
10 // Roteamento da API
11 if (path === '/api/save-flowchart' && req.method === 'POST') {
12 return await saveFlowchart(req);
13 }
14
15 if (path === '/api/convert-to-ai' && req.method === 'POST') {
16 return await convertToAI(req);
17 }
18
19 if (path === '/api/load-flowchart' && req.method === 'GET') {
20 return await loadFlowchart(req);
21 }
22
23 if (path === '/api/export-json' && req.method === 'POST') {
24 return await exportJSON(req);
25 }
26
27 if (path === '/api/import-json' && req.method === 'POST') {
28 return await importJSON(req);
29 }

untitled-5696DEMO.md8 matches

@tallesjp•Updated 1 day ago
15- Arrastar e soltar componentes da paleta
16- Edição de nós com duplo-clique
17- Múltiplos tipos de nós: Início, Processo, Decisão, Entrada, Saída, API, Fim
18- Subtipos específicos para cada tipo de nó
19
63#### šŸ“¤ SaĆ­da
64- **Função**: Exibir resultados ou dados
65- **Subtipos**: Exibir, Arquivo, Notificação, Resposta API
66- **Uso**: Apresentação de resultados
67
68#### 🌐 API
69- **Função**: Chamadas para APIs externas
70- **Subtipos**: REST API, GraphQL, Webhook, Database
71- **Uso**: Integração com serviços externos
72
88[InĆ­cio] → [Entrada: Nome do usuĆ”rio] → [Processo: Validar nome] → [DecisĆ£o: Nome vĆ”lido?]
89 ↓ (Sim) ↓ (NĆ£o)
90[API: Buscar dados] → [SaĆ­da: Exibir resultado] → [Fim] [SaĆ­da: Erro] → [Fim]
91```
92
160### Tratamento de Erros
161- Retry automƔtico para timeouts
162- Fallbacks para erros de API
163- Validação de entrada com retry
164
169- `collect_user_input`: Coleta de entrada
170- `display_output`: Exibição de saída
171- `make_api_call`: Chamadas de API
172- `database_operation`: OperaƧƵes de banco
173- `iterate`: Loops e iteraƧƵes

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"
Plantfo

Plantfo8 file matches

@Llad•Updated 9 hours ago
API for AI plant info

scrapeCraigslistAPI1 file match

@shapedlines•Updated 22 hours ago
apiry
snartapi