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=10&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 15445 results for "api"(1634ms)

Upworkindex.ts3 matches

@PortfolioFreelanceβ€’Updated 12 hours ago
32});
33
34// API endpoint for contact form (placeholder)
35app.post("/api/contact", async c => {
36 const body = await c.req.json();
37
51
52// Health check endpoint
53app.get("/api/health", c => {
54 return c.json({ status: "ok", timestamp: new Date().toISOString() });
55});

Upworkindex.html2 matches

@PortfolioFreelanceβ€’Updated 12 hours ago
15
16 <!-- Google Fonts -->
17 <link rel="preconnect" href="https://fonts.googleapis.com">
18 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
19 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap" rel="stylesheet">
20
21 <!-- Error Debugging -->

bloglive-reload.ts1 match

@charmaineβ€’Updated 13 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

blogget-old-posts.ts25 matches

@charmaineβ€’Updated 13 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",

blog2025-05-23-glitch.md1 match

@charmaineβ€’Updated 13 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.

blog2025-04-23-upgrading.md9 matches

@charmaineβ€’Updated 13 hours ago
8Today, we’re unifying our two primitives β€” *vals* and *projects* β€” into a single primitive: the **val**, with the best features of both.
9
10Historically, vals have been simple and lightweight, but limited to a single file. This upgrade will preserve the elegant spirit of our platform while supporting more complex code and collaborative workflows. This upgrade will help you create bigger things on Val Town – APIs, internal tools, fullstack apps, blogs ([like this one](https://www.val.town/x/valdottown/blog)), and much more – without sacrificing the simplicity you've always loved about vals.
11
12*Legacy vals* will temporarily become *projects* during this migration. Post-migration, the concept of *projects* will disappear entirely β€” leaving only upgraded *vals*. In short: *legacy vals* β†’ *projects* β†’ *vals*.
16For most users, no upgrade action is required. We’ll auto-migrate your vals next week. All existing HTTP endpoints, crons, email handlers, and custom domains will be preserved.
17
18For those with mission-critical vals or who use our API to edit or create vals, you can start upgrading your legacy vals today and integrating with our updated API.
19
20- **April 23, 2025** – Announcement of changes & API deprecations.
21- **April 30, 2025** – All remaining *legacy vals* auto-upgraded. Deprecated API routes become read-only.
22- **May 1, 2025** – The term *projects* will no longer exist β€” everything will simply be a *val*.
23
35[See more details in our docs.](https://docs.val.town/upgrading/legacy-vals)
36
37## API Changes
38
39Today, we're introducing the following API routes:
40
41```bash
73```
74
75View our [updated API reference here](https://docs.val.town/openapi).
76
77All `v1/vals` API routes become read-only on **April 30, 2025**. If you rely on *writing* to those routes, please upgrade to our new `v2/vals` API. All deprecated API routes will continue serving historical legacy val data.
78
79### SDK changes
85
861. Upgrade your mission-critical vals early.
872. Update your Val Town API & SDK usage to `/v2` routes.
883. All remaining legacy vals migrate on **April 30, 2025**.
894. Migration completes on **May 1, 2025**.

blog2025-04-08-migration.md1 match

@charmaineβ€’Updated 13 hours ago
83We didn't. We left them where they are, and proxy to them.
84
85Writing a proxy in Val Town (or any functions platform with the ['fetch handler' interface](https://blog.val.town/blog/the-api-we-forgot-to-name/)) is a delight:
86
87```ts

WillpersonalWebsiteasynchrousCode.tsx1 match

@willthereaderβ€’Updated 13 hours ago
25 <p>
26 Asynchronous code is code that has to wait to get responses from external sources. For example if the code
27 makes a request for data via an API, the asynchronous part is when you wait for the response. A promise is an object representing the eventual Mission or failure of the asynchronous operation.
28 </p>
29

makemeavalREADME.md7 matches

@charmaineβ€’Updated 14 hours ago
15```
16β”œβ”€β”€ backend/
17β”‚ └── index.ts # Main Hono server with API routes
18β”œβ”€β”€ frontend/
19β”‚ β”œβ”€β”€ index.html # Main HTML template
25```
26
27## API Endpoints
28
29- `GET /` - Serves the main application
30- `GET /api/quote` - Returns a random inspirational quote
31- `GET /api/weather?lat={lat}&lon={lon}` - Returns weather data for coordinates
32- `POST /api/gratitude` - Saves a gratitude entry
33- `GET /api/gratitude` - Retrieves recent gratitude entries
34
35## Tech Stack
39- **Styling**: TailwindCSS
40- **Storage**: Val Town Blob Storage
41- **Weather**: Open-Meteo API (no API key required)
42
43## Usage

makemeavalapp.html2 matches

@charmaineβ€’Updated 14 hours ago
8 <script src="https://esm.town/v/std/catch"></script>
9 <link rel="stylesheet" href="/frontend/style.css">
10 <link rel="preconnect" href="https://fonts.googleapis.com">
11 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
12 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
13</head>
14<body class="bg-gradient-to-br from-green-50 via-emerald-50 to-teal-100 min-h-screen font-sans">

HN-fetch-call2 file matches

@ImGqbβ€’Updated 1 day ago
fetch HackerNews by API

token-server1 file match

@kwhinnery_openaiβ€’Updated 3 days ago
Mint tokens to use with the OpenAI Realtime API for WebRTC
Kapil01
apiv1