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=fetch&page=1&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 14486 results for "fetch"(1585ms)

No matches found in users.

Try switching to another result type using the tabs above.

valSourceindex.ts6 matches

@curtcox•Updated 40 mins ago
362
363 try {
364 // Fetch the source code
365 const response = await fetch(sourceUrl);
366 if (!response.ok) {
367 return c.text(`Failed to fetch source: ${response.status}`, 404);
368 }
369
611 async function detectBlock(code, line, column) {
612 if (blockDetectorUrl) {
613 const response = await fetch(blockDetectorUrl, {
614 method: 'POST',
615 headers: { 'Content-Type': 'application/json' },
624 async function explainBlock(code, blockInfo) {
625 if (blockExplainerUrl) {
626 const response = await fetch(blockExplainerUrl, {
627 method: 'POST',
628 headers: { 'Content-Type': 'application/json' },
770}
771
772export default app.fetch;

valSourceREADME.md3 matches

@curtcox•Updated 48 mins ago
39```
40
41This will fetch the source from `https://esm.town/v/nbbaier/sqliteExplorerApp@100-main/main.tsx` and display it with annotations.
42
43### Custom Functions
136
1371. **URL Parsing**: Extracts the val path from the URL
1382. **Source Fetching**: Fetches source code from `https://esm.town/v/{path}`
1393. **Language Detection**: Determines language from file extension
1404. **Syntax Highlighting**: Applies syntax highlighting using Prism.js
155## Error Handling
156
157- Returns 404 if the source URL cannot be fetched
158- Returns 400 for invalid path formats
159- Returns 500 for other errors with error messages

testWeatherFetcher1 file match

@sjaskeprut•Updated 2 days ago

weatherFetcher1 file match

@sjaskeprut•Updated 2 days ago