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%20%22Image%20title%22?q=api&page=21&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 20509 results for "api"(1921ms)

ideasmain.tsx1 match

@join•Updated 2 days ago
226 });
227
228 // --- API Calls ---
229 async function fetchIdeas(topic) {
230 ideaSelector.innerHTML = '<option>Synthesizing concepts...</option>';

ostpolispambsky.ts1 match

@stilobic•Updated 2 days ago
1import { BskyAgent } from "npm:@atproto/api";
2
3// constants

ostpolispammeteo.ts3 matches

@stilobic•Updated 2 days ago
13const ANNEMASSE_LATITUDE = "46.1933";
14const ANNEMASSE_LONGITUDE = "6.2342";
15const METEO_API_VERSION = 1;
16const METEO_API_BASE = `https://api.open-meteo.com/v${METEO_API_VERSION}`;
17
18// functions
20export async function getCurrentTemperature(): Promise<number> {
21 const resourceUrl =
22 `${METEO_API_BASE}/forecast?latitude=47.3769&longitude=8.5417&current=temperature_2m&timezone=auto`;
23 const res = await fetch(resourceUrl);
24 validateResponse(res);

formalforgemain.tsx4 matches

@join•Updated 2 days ago
47 <meta name="viewport" content="width=device-width, initial-scale=1.0">
48 <title>The Formal Letter Forge</title>
49 <link rel="preconnect" href="https://fonts.googleapis.com">
50 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
51 <link href="https://fonts.googleapis.com/css2?family=Lora:wght@400;600&family=Source+Sans+3:wght@400;600;700&display=swap" rel="stylesheet">
52<style>
53 :root {
255<script>
256(function() {
257 const API_URL = '${sourceUrl}';
258 const THEME_KEY = 'formal_forge_theme';
259 let commandPaletteItems = [];
422 try {
423 updateStatus('Initiating Process...', 'Sending context to strategists.');
424 const response = await fetch(\`\${API_URL}?action=forge\`, {
425 method: 'POST',
426 headers: { 'Content-Type': 'application/json' },

github-apiindex.tsx5 matches

@cricks_unmixed4u•Updated 2 days ago
8 getGitHubIssuesUpdatedSinceLastRun,
9 getIssueContentAsMarkdown,
10} from "../api/index.tsx";
11import { createGitHubClient } from "../shared/github-utils.ts";
12
55});
56
57// API Routes with authentication
58app.get("/api/issues", requireAuth, async (c) => {
59 try {
60 const repoOwner = c.req.query("owner") || "oguzhanogreden";
79});
80
81app.get("/api/issues/:number/content", requireAuth, async c => {
82 try {
83 const issueNumber = parseInt(c.req.param("number"));
98
99// New endpoint with query parameter authentication
100app.get("/api/markdown/:number", async c => {
101 try {
102 const licenseKey = Deno.env.get("LICENSE_KEY");

ostpolispamutils.ts1 match

@stilobic•Updated 2 days ago
1export function validateResponse(res: Response): void {
2 if (!res.ok) throw new Error(`api error: ${res.status}: ${res.statusText}`);
3 if (res.status < 200 || res.status >= 300)
4 throw new Error(`Unexpected status code: ${res.status}: ${res.statusText}`);

github-apiknowledge.md13 matches

@cricks_unmixed4u•Updated 2 days 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`
299## Retrieving GitHub Issue Content as Markdown
300
301The new functionality added in the GitHub API library allows developers to fetch a specific issue's content from a GitHub repository and format it in Markdown. This includes both the issue's main description and all comments associated with that issue, with any URLs present in the text also extracted and listed.
302
303### Function Overview
328
329```tsx
330import { getIssueContentAsMarkdown } from 'https://esm.town/v/cricks_unmixed4u/github-api/api/index.tsx?v=30'; // Ensure to use the correct version based on the function declaration.
331
332async function displayIssueContent() {
358This new functionality streamlines the process of retrieving and displaying GitHub issue content and enhances collaboration and visibility in development environments.
359
360# DONE: Next Step 1 - Export a new function from api
361
362The new function should return the relevant content of a given issue in markdown format.

ProposalHandler.cursorrules10 matches

@lightweight•Updated 2 days 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`

github-apiApp.tsx1 match

@cricks_unmixed4u•Updated 2 days ago
53
54 try {
55 const response = await fetch(`/api/issues?owner=${repoOwner}&repo=${repoName}`, {
56 headers: {
57 "Authorization": `Bearer ${key || licenseKey}`,

github-apiIssueViewer.tsx1 match

@cricks_unmixed4u•Updated 2 days ago
44 try {
45 const response = await fetch(
46 `/api/issues/${issue.number}/content?owner=${repoOwner}&repo=${repoName}`,
47 {
48 headers: {

claude-api1 file match

@ziyanwould•Updated 12 hours ago

api-workshop

@danarddanielsjr•Updated 1 day ago
replicate
Run AI with an API
fiberplane
Purveyors of Hono tooling, API Playground enthusiasts, and creators of 🪿 HONC 🪿 (https://honc.dev)