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/...?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 18786 results for "api"(1387ms)

tuempresaValidationCatalogGemini.tsx4 matches

@arequipe•Updated 12 mins ago
4
5export default async function validateCartaPorteData(req: Request): Promise<Response> {
6 const AIRTABLE_API_KEY = Deno.env.get("AIRTABLE_API_KEY")!;
7 const AIRTABLE_BASE_ID = Deno.env.get("AIRTABLE_BASE_ID")!;
8 const VIAJES_TABLE = Deno.env.get("VIAJES_TABLE")!; // Corregido
15
16 const airtableHeaders = {
17 Authorization: `Bearer ${AIRTABLE_API_KEY}`,
18 "Content-Type": "application/json",
19 };
25
26 const fetchLinkedRecord = async (tableId: string, recordId: string) => {
27 const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${tableId}/${recordId}`, {
28 headers: airtableHeaders,
29 });
43
44 const updateAirtableFields = async (targetTable: string, targetRecordId: string, fields: Record<string, any>) => {
45 const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${targetTable}/${targetRecordId}`, {
46 method: "PATCH",
47 headers: airtableHeaders,

Louapi_scheduler_trigger.tsx5 matches

@jeffvincent•Updated 28 mins ago
1// Lou Fantasy Baseball Manual Scheduler Trigger API
2// Val.town HTTP endpoint for manually triggering the daily scheduler
3
5
6export default async function(req: Request): Promise<Response> {
7 console.log("Manual scheduler trigger API called");
8
9 // Parse request
45 }
46 } catch (error) {
47 console.error("API error:", error);
48 return createErrorResponse(
49 "Internal Server Error",
74 yahoo_client_secret: Deno.env.get("YAHOO_CLIENT_SECRET") ? "✓ Set" : "✗ Missing",
75 yahoo_redirect_uri: Deno.env.get("YAHOO_REDIRECT_URI") || "✗ Missing",
76 val_town_api_token: Deno.env.get("valtown") ? "✓ Set" : "✗ Missing",
77 },
78 timestamp: new Date().toISOString(),
99 yahoo_client_secret: Deno.env.get("YAHOO_CLIENT_SECRET") ? "✓ Set" : "✗ Missing",
100 yahoo_redirect_uri: Deno.env.get("YAHOO_REDIRECT_URI") || "✗ Missing",
101 val_town_api_token: Deno.env.get("VAL_TOWN_API_TOKEN") ? "✓ Set" : "✗ Missing",
102 default_user_id: Deno.env.get("DEFAULT_USER_ID") || "default_user",
103 },

CheckExamplemain.tsx1 match

@wolf•Updated 31 mins ago
3 headers: {
4 "Content-Type": "application/json",
5 "x-val-town-api-key": Deno.env.get("valtown")!,
6 },
7});

untitled-2430main.tsx3 matches

@Rinku123•Updated 31 mins ago
15 - Update the quote box with the returned text.
16
174. In Python (Flask or FastAPI):
18 - Read a list of motivational quotes from an external file (`quotes.txt` or `quotes.json`) stored on the server.
19 - Randomly select one quote per request.
20 - Expose a single API endpoint (e.g., `/api/quote`) that returns the selected quote in JSON format.
21
225. Store at least 10 motivational quotes in a `quotes.txt` (one quote per line) or `quotes.json` file.
23
246. Ensure the app can be run locally:
25 - Provide instructions to install dependencies (`pip install flask` or `fastapi`, etc.).
26 - Include a short README with steps to start the server and open the HTML page in a browser.
27

tuempresaValidationCatalogGrok.tsx3 matches

@arequipe•Updated 1 hour ago
1import { blob } from "@valtown/blob";
2
3const AIRTABLE_API_KEY = Deno.env.get("AIRTABLE_API_KEY")!;
4const AIRTABLE_BASE_ID = Deno.env.get("AIRTABLE_BASE_ID")!;
5const VIAJES_TABLE = "Viajes";
7
8const airtableHeaders = {
9 Authorization: `Bearer ${AIRTABLE_API_KEY}`,
10 "Content-Type": "application/json",
11};
12
13async function fetchRecord(table: string, recordId: string) {
14 const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${table}/${recordId}`, {
15 headers: airtableHeaders,
16 });

vt-testsemailAnalyzer.http.tsx2 matches

@dervondenbergen•Updated 2 hours ago
33 try {
34 const anthropic = new Anthropic({
35 apiKey: Deno.env.get("ANTHROPIC_API_KEY"),
36 });
37
103
104 } catch (error) {
105 console.error(`Error calling Claude API for ${email}:`, error);
106 return new Response(
107 JSON.stringify({

vt-testsCLAUDE.md1 match

@dervondenbergen•Updated 2 hours ago
20- Compiler options are relaxed (`noImplicitAny: false`, `strict: false`)
21- Val Town types are included from `https://www.val.town/types/valtown.d.ts`
22- Experimental Node.js globals, Temporal API, and worker options are enabled
23
24### Val Town Development Patterns

ChatApp.tsx8 matches

@c15r•Updated 3 hours ago
15
16export interface AppConfig {
17 anthropicApiKey: string;
18 mcpServers: MCPServerConfig[];
19 selectedModel: string;
39export default function App() {
40 const [config, setConfig] = useState<AppConfig>({
41 anthropicApiKey: "",
42 mcpServers: [],
43 selectedModel: "claude-3-5-sonnet-20241022",
53 // Load config from localStorage on mount
54 useEffect(() => {
55 const savedApiKey = localStorage.getItem("anthropic_api_key");
56 const savedMcpServers = localStorage.getItem("mcp_servers");
57 const savedMessages = localStorage.getItem("chat_messages");
60
61 setConfig({
62 anthropicApiKey: savedApiKey || "",
63 mcpServers: savedMcpServers ? JSON.parse(savedMcpServers) : DEFAULT_MCP_SERVERS,
64 selectedModel: savedModel || "claude-3-5-sonnet-20241022",
76 }
77
78 // Show settings if no API key is configured
79 if (!savedApiKey) {
80 setShowSettings(true);
81 }
84 // Save config to localStorage when it changes
85 useEffect(() => {
86 if (config.anthropicApiKey) {
87 localStorage.setItem("anthropic_api_key", config.anthropicApiKey);
88 }
89 localStorage.setItem("mcp_servers", JSON.stringify(config.mcpServers));

FarcasterSpacesSpace.tsx2 matches

@moe•Updated 3 hours ago
139
140 const queryFn = () =>
141 fetch(`/api/channels`)
142 .then((r) => r.json())
143 .then((r) => r?.data?.channels?.find((c) => c.channel_name == channel))
146
147 const join = async () => {
148 const response = await fetch(`/api/token?channel=${channel}&uid=${uid}`).then((r) => r.json())
149 console.log('response', response)
150 setToken(response.token)

FarcasterSpacesimage.tsx3 matches

@moe•Updated 3 hours ago
135
136const loadEmoji = (code) => {
137 // const api = `https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${code.toLowerCase()}.svg`
138 const api = `https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${code.toLowerCase()}_color.svg`
139 return fetch(api).then((r) => r.text())
140}
141

api_zenithpayments_com

@ianmenethil•Updated 1 hour ago

helloEffectHttpApi1 file match

@mattrossman•Updated 14 hours ago
apiry
snartapi