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=3&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 21177 results for "api"(6655ms)

postherousREADME.md5 matches

@paulkinlanUpdated 9 hours ago
23
24### Backend (`/backend/`)
25- `index.ts` - Main Hono server with HTML generation and API routes ✅
26- `database/` - SQLite schema and query functions ✅
27- `services/` - External service integrations ✅
53- `ATPROTO_PASSWORD` - AT Protocol app password
54
55## 📊 API Endpoints
56
57- `GET /` - Main blog interface
58- `GET /post/:slug` - Individual post page
59- `GET /rss` - RSS 2.0 feed
60- `GET /api/posts` - JSON API for posts
61- `GET /api/posts/:slug` - JSON API for single post
62- `GET /websub` - WebSub subscription endpoint
63- `GET /.well-known/webfinger` - WebFinger discovery for ActivityPub ✅
67- `GET /following` - ActivityPub following collection ✅
68- `POST /inbox` - ActivityPub inbox (processes Follow, Like, Announce, Undo) ✅
69- `GET /api/posts/:slug/activities` - Get activity counts (likes, shares, replies) ✅
70- `GET /health` - Health check
71

assistant-requestmain.tsx3 matches

@andreystarenkyUpdated 9 hours ago
32 let ivrData: any;
33 try {
34 const response = await fetch("https://ivr-api.withcherry.com/v3/users", {
35 method: "POST",
36 headers: {
51
52 if (!response.ok) {
53 console.error("⚠️ IVR API error status:", response.status);
54 return new Response("IVR Service Unavailable", { status: 503 });
55 }
57 ivrData = await response.json();
58 } catch (err) {
59 console.error("⚠️ IVR API fetch error:", err);
60 return new Response("Internal Server Error", { status: 500 });
61 }

github-apiindex.tsx6 matches

@cricks_unmixed4uUpdated 9 hours ago
11 getGitHubIssuesUpdatedSinceLastRun,
12 getIssueContentAsMarkdown,
13} from "../api/index.tsx";
14
15import { createGitHubClient } from "../shared/github-utils.ts";
59});
60
61// API Routes with authentication
62app.get("/api/issues", requireAuth, async (c) => {
63 try {
64 const repoOwner = c.req.query("owner") || "oguzhanogreden";
83});
84
85app.get("/api/issues/:number/content", requireAuth, async (c) => {
86 try {
87 const issueNumber = parseInt(c.req.param("number"));
103
104// New endpoint with query parameter authentication
105app.get("/api/markdown/:number", async (c) => {
106 try {
107 const licenseKey = Deno.env.get("LICENSE_KEY");
131});
132
133app.post("/api/agents/archiver", requireAuth, async (c: Context) => {
134 try {
135 const licenseKey = Deno.env.get("LICENSE_KEY");

postheroustest-activitypub-inbox.ts3 matches

@paulkinlanUpdated 9 hours ago
89
90 // Check activity counts for the post
91 const activityResponse = await fetch(`${BASE_URL}/api/posts/test/activities`);
92 if (activityResponse.ok) {
93 const activityData = await activityResponse.json();
132
133 // Check activity counts for the post
134 const activityResponse = await fetch(`${BASE_URL}/api/posts/test/activities`);
135 if (activityResponse.ok) {
136 const activityData = await activityResponse.json();
205 // Get final activity counts for test post
206 try {
207 const activityResponse = await fetch(`${BASE_URL}/api/posts/test/activities`);
208 if (activityResponse.ok) {
209 const activityData = await activityResponse.json();

github-apiApp.tsx2 matches

@cricks_unmixed4uUpdated 10 hours ago
61 try {
62 const response = await fetch(
63 `/api/agents/archiver?owner=${repoOwner}&repo=${repoName}&issueNumber=${selectedIssue.number}`,
64 {
65 method: "POST",
91 try {
92 const response = await fetch(
93 `/api/issues?owner=${repoOwner}&repo=${repoName}`,
94 {
95 headers: {

rust-nyc-event-signinEventLinks.tsx1 match

@colelUpdated 10 hours ago
18 const loadEventDetails = async () => {
19 try {
20 const response = await fetch(`/api/${eventId}`);
21 if (!response.ok) throw new Error('Failed to load event details');
22 const data: EventDetailsResponse = await response.json();

rust-nyc-event-signinApp.tsx2 matches

@colelUpdated 10 hours ago
61 return (
62 <>
63 <link rel="preconnect" href="https://fonts.googleapis.com" />
64 <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
65 <link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital,wght@0,400;0,600;1,400&display=swap" rel="stylesheet" />
66
67 <style>{`

github-apiknowledge.md13 matches

@cricks_unmixed4uUpdated 10 hours 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.

rust-nyc-event-signindeploy.yml1 match

@colelUpdated 11 hours ago
24 run: vt push
25 env:
26 VAL_TOWN_API_KEY: ${{ secrets.VAL_TOWN_API_KEY }}
27

rust-nyc-event-signintypes.ts1 match

@colelUpdated 11 hours ago
22}
23
24// API request/response types
25export interface CreateEventRequest {
26 name: string;

github-api8 file matches

@cricks_unmixed4uUpdated 9 hours ago
Very incomplete collection of useful GitHub API adapters

myAPiKey

@Kix111Updated 12 hours ago
papimark21
codingpapi