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/image-url.jpg?q=api&page=96&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 18984 results for "api"(4566ms)

Townie-2Home.tsx5 matches

@dinavinter•Updated 1 week ago
32 <ol>
33 <li>
34 Login with your Val Town API token (with projects:read, projects:write, user:read permissions)
35 </li>
36 <li>Select a project to work on</li>
70 </div>
71 <h3>Cost Tracking</h3>
72 <p>See estimated API usage costs for each interaction</p>
73 </div>
74 </section>
79 <ul>
80 <li>React frontend with TypeScript</li>
81 <li>Hono API server backend</li>
82 <li>Web Audio API for sound notifications</li>
83 <li>AI SDK for Claude integration</li>
84 </ul>
85 <p>
86 The application proxies requests to the Anthropic API and Val Town API, allowing Claude to view and edit your
87 project files directly.
88 </p>

Townie-2.cursorrules10 matches

@dinavinter•Updated 1 week ago
13- Generate code in TypeScript or TSX
14- Add appropriate TypeScript types and interfaces for all data structures
15- Prefer official SDKs or libraries than writing API calls directly
16- Ask the user to supply API or library documentation if you are at all unsure about it
17- **Never bake in secrets into the code** - always use environment variables
18- Include comments explaining complex logic (avoid commenting obvious operations)
23### 1. HTTP Trigger
24
25- Create web APIs and endpoints
26- Handle HTTP requests and responses
27- Example structure:
173However, it's *extremely importing* to note that `parseProject` and other Standard Library utilities ONLY RUN ON THE SERVER.
174If you need access to this data on the client, run it in the server and pass it to the client by splicing it into the HTML page
175or by making an API request for it.
176
177## Val Town Platform Specifics
181- **AI Image:** To inline generate an AI image use: `<img src="https://maxm-imggenurl.web.val.run/the-description-of-your-image" />`
182- **Storage:** DO NOT use the Deno KV module for storage
183- **Browser APIs:** DO NOT use the `alert()`, `prompt()`, or `confirm()` methods
184- **Weather Data:** Use open-meteo for weather data (doesn't require API keys) unless otherwise specified
185- **View Source:** Add a view source link by importing & using `import.meta.url.replace("ems.sh", "val.town)"` (or passing this data to the client) and include `target="_top"` attribute
186- **Error Debugging:** Add `<script src="https://esm.town/v/std/catch"></script>` to HTML to capture client-side errors
187- **Error Handling:** Only use try...catch when there's a clear local resolution; Avoid catches that merely log or return 500s. Let errors bubble up with full context
188- **Environment Variables:** Use `Deno.env.get('keyname')` when you need to, but generally prefer APIs that don't require keys
189- **Imports:** Use `https://esm.sh` for npm and Deno dependencies to ensure compatibility on server and browser
190- **Storage Strategy:** Only use backend storage if explicitly required; prefer simple static client-side sites
224### Backend (Hono) Best Practices
225
226- Hono is the recommended API framework
227- Main entry point should be `backend/index.ts`
228- **Static asset serving:** Use the utility functions to read and serve project files:
248 });
249 ```
250- Create RESTful API routes for CRUD operations
251- Always include this snippet at the top-level Hono app to re-throwing errors to see full stack traces:
252 ```ts
285 - For files in the project, use `readFile` helpers
286
2875. **API Design:**
288 - `fetch` handler is the entry point for HTTP vals
289 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`

registryfile1 match

@dinavinter•Updated 1 week ago
186});
187
188// API endpoint to get specific file content
189app.get("/:zon/:file/raw", async (c: Context) => {
190 const { zon, file } = c.req.param();

Joalda_couturemain.tsx2 matches

@GideonEsq•Updated 1 week ago
80 <title>Joalda Fashion</title>
81 <meta name="viewport" content="width=device-width, initial-scale=1">
82 <link href="https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;600&display=swap" rel="stylesheet">
83 <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
84 <style>
85 body {

registryfile.readme1 match

@dinavinter•Updated 1 week ago
66});
67
68// API endpoint to get specific file content
69app.get("/:zon/:file/raw", async (c: Context) => {
70 const { zon, file } = c.req.param();

tsjScrapertodos.md1 match

@alexwein•Updated 1 week ago
47**Usage**:
481. Run `main.tsx` to scrape and cache data (script val)
492. Access `results.tsx` to get the JSON API of all cached reviews (HTTP val)
50
51**Database Schema**:

registryfile.http1 match

@dinavinter•Updated 1 week ago
63});
64
65// API endpoint to get specific file content
66app.get("/:zon/:file/raw", async (c: Context) => {
67 const { zon, file } = c.req.param();

registryfile.cron1 match

@dinavinter•Updated 1 week ago
63});
64
65// API endpoint to get specific file content
66app.get("/:zon/:file/raw", async (c: Context) => {
67 const { zon, file } = c.req.param();

registryREADME.md3 matches

@dinavinter•Updated 1 week ago
81## File Types Supported
82
83- **HTTP** (`http`) - Web endpoints and APIs
84- **Cron** (`cron`) - Scheduled tasks
85- **Email** (`email`) - Email handlers
98- `GET /` - Redirects to main gallery
99- `GET /{zon-name}` - View files in specific zon
100- `GET /{zon-name}/files` - API endpoint returning JSON list of files
101- Groups files by type and shows file metadata
102
1875. **Run HTTP files**: Use the Run button to test HTTP endpoints
188
189## API Integration
190
191The system integrates with:

registryfile.default1 match

@dinavinter•Updated 1 week ago
104});
105
106// API endpoint to get specific file content
107app.get("/:zon/:file/raw", async (c: Context) => {
108 const { zon, file } = c.req.param();
Plantfo

Plantfo8 file matches

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

beeminder-api4 file matches

@cricks_unmixed4u•Updated 22 hours ago
apiry
snartapi