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/$1?q=api&page=9&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 15182 results for "api"(1618ms)

cerebras_codergenerate-code.ts1 match

@Zulqarnain•Updated 9 hours ago
16 };
17 } else {
18 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
19 const completion = await client.chat.completions.create({
20 messages: [

my-first-valDashboard.tsx1 match

@Mahi77•Updated 10 hours ago
167 <div className="flex justify-between">
168 <span className="text-gray-600">Current Tab</span>
169 <span className="font-medium capitalize">{activeTab}</span>
170 </div>
171 </div>

my-first-valindex.ts4 matches

@Mahi77•Updated 10 hours ago
27});
28
29// API routes
30app.route('/api/auth', authRoutes);
31app.route('/api/media', mediaRoutes);
32
33// Serve static files
42 // Inject initial configuration
43 const config = {
44 apiUrl: '/api',
45 maxFileSize: 50 * 1024 * 1024, // 50MB
46 supportedFormats: {

my-first-valai-analysis.ts3 matches

@Mahi77•Updated 10 hours ago
78 try {
79 // For audio analysis, we'll use Whisper for transcription and then analyze the text
80 // Note: This is a simplified approach. In production, you might want to use specialized audio analysis APIs
81
82 // Convert base64 to blob for Whisper API
83 const base64Data = audioData.replace(/^data:audio\/[^;]+;base64,/, '');
84 const audioBuffer = Uint8Array.from(atob(base64Data), c => c.charCodeAt(0));
85 const audioBlob = new Blob([audioBuffer], { type: 'audio/wav' });
86
87 // Create a File object for the API
88 const audioFile = new File([audioBlob], fileName, { type: 'audio/wav' });
89

my-first-valtypes.ts1 match

@Mahi77•Updated 10 hours ago
58}
59
60export interface ApiResponse<T = any> {
61 success: boolean;
62 data?: T;

my-first-valREADME.md12 matches

@Mahi77•Updated 10 hours ago
15
16### Backend (`/backend/`)
17- **index.ts**: Main Hono server with API routes
18- **database/**: SQLite database setup and queries
19- **routes/**: Modular route handlers
23- **index.html**: Main application shell
24- **components/**: React components for UI
25- **services/**: API communication and media handling
26- **utils/**: Client-side utilities
27
30- **utils.ts**: Shared utility functions
31
32## API Endpoints
33
34- `POST /api/auth/login` - User login
35- `POST /api/auth/signup` - User registration
36- `POST /api/auth/logout` - User logout
37- `GET /api/auth/me` - Get current user
38- `POST /api/media/analyze` - Analyze uploaded media
39- `POST /api/media/search` - Search similar content
40- `GET /api/media/history` - Get user's analysis history
41
42## Technology Stack
43
44- **Backend**: Hono, SQLite, OpenAI API
45- **Frontend**: React, TailwindCSS
46- **AI/ML**: OpenAI GPT-4 Vision, Whisper
51
521. Set up environment variables:
53 - `OPENAI_API_KEY`: Your OpenAI API key
54 - `JWT_SECRET`: Secret for JWT token signing
55

ProtoSharecontent.ts1 match

@c15r•Updated 11 hours ago
17}
18
19// Middleware to check bearer token for API access
20async function requireBearerToken(c: any, next: any) {
21 const authHeader = c.req.header("Authorization");

blog-3live-reload.ts1 match

@jxnblk•Updated 11 hours ago
82 // if we wanted to create a /lastUpdatedAt route,
83 // which would let us pass a val town bearer token, we could do that here
84 // gives us 10k API requests per minute instead of 1k
85 // and would work with private projects
86

blog-3get-old-posts.ts25 matches

@jxnblk•Updated 11 hours ago
19export const oldPosts: BlogPost[] = [
20 {
21 "title": "Solving the internal / external API riddle",
22 "slug": "api-conundrum",
23 "link": "/blog/api-conundrum",
24 "description": "Figuring out how to provide an API that's usable by everyone and fast for us to iterate on",
25 "pubDate": "Thu, 27 Mar 2025 00:00:00 GMT",
26 "author": "Tom MacWright",
27 },
28 {
29 "title": "API Tokens Scopes",
30 "slug": "api-token-scopes",
31 "link": "/blog/api-token-scopes",
32 "description": "Improving security with granular control over permissions",
33 "pubDate": "Fri, 01 Nov 2024 00:00:00 GMT",
59 },
60 {
61 "title": "Expanding the Vals API - RFC",
62 "slug": "expanding-the-vals-api-rfc",
63 "link": "/blog/expanding-the-vals-api-rfc",
64 "description": "Our REST API lets you do a lot - and soon it will enable more",
65 "pubDate": "Fri, 30 Jun 2023 00:00:00 GMT",
66 "author": "André Terron",
133 },
134 {
135 "title": "The perks of a good OpenAPI spec",
136 "slug": "openapi",
137 "link": "/blog/openapi",
138 "description": "Taking advantage of our typed REST API to build a platform around\nVal Town.",
139 "pubDate": "Thu, 25 Jul 2024 00:00:00 GMT",
140 "author": "Tom MacWright",
262 },
263 {
264 "title": "The API we forgot to name",
265 "slug": "the-api-we-forgot-to-name",
266 "link": "/blog/the-api-we-forgot-to-name",
267 "description": "An API that takes a Request and returns a Response - what was that, again?",
268 "pubDate": "Thu, 19 Oct 2023 00:00:00 GMT",
269 "author": "Steve Krouse",
286 },
287 {
288 "title": "Deprecating the Run API",
289 "slug": "deprecating-the-run-api",
290 "link": "/blog/deprecating-the-run-api",
291 "description": "Not every function should be an API",
292 "pubDate": "Wed, 07 Feb 2024 00:00:00 GMT",
293 "author": "André Terron",
321 "slug": "val-town-newsletter-1",
322 "link": "/blog/val-town-newsletter-1",
323 "description": "Programmatic notifications, Hacker News API, and more.",
324 "pubDate": "Wed, 04 Jan 2023 00:00:00 GMT",
325 "author": "Steve Krouse",
450 "slug": "val-town-newsletter-22",
451 "link": "/blog/val-town-newsletter-22",
452 "description": "Townie upgrades, Scoped API permissions, Fal partnership",
453 "pubDate": "Mon, 02 Dec 2024 00:00:00 GMT",
454 "author": "Steve Krouse",

blog-32025-05-23-glitch.md1 match

@jxnblk•Updated 11 hours ago
41going to promise that your Val Town projects will still work in the year 2500,
42because we both know that I'd be lying. Like Glitch, we've raised money from
43venture capital and it is currently what pays our paychecks and server bills.
44If it runs out and we haven't become profitable or found an acquirer, that'll
45be curtains.

HN-fetch-call2 file matches

@ImGqb•Updated 17 hours ago
fetch HackerNews by API

token-server1 file match

@kwhinnery_openai•Updated 2 days ago
Mint tokens to use with the OpenAI Realtime API for WebRTC
Kapil01
apiv1