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=84&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 12660 results for "api"(1059ms)

blog2025-04-23-upgrading.md9 matches

@jamiesinclairβ€’Updated 6 days 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

@jamiesinclairβ€’Updated 6 days 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

news-nowapp.tsx2 matches

@jamiesinclairβ€’Updated 6 days ago
14app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
15
16// Add your API routes here
17// app.get("/api/data", c => c.json({ hello: "world" }));
18
19// Unwrap and rethrow Hono errors as the original error

reactHonoStarterindex.ts2 matches

@texoportβ€’Updated 6 days ago
12app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
13
14// Add your API routes here
15// app.get("/api/data", c => c.json({ hello: "world" }));
16
17// Unwrap and rethrow Hono errors as the original error

French_Bulldogmain.tsx1 match

@ynonpβ€’Updated 6 days ago
79 // This is a no-op if nothing's changed
80 if (!isEndpointSet) {
81 await bot.api.setWebhook(req.url, {
82 secret_token: SECRET_TOKEN,
83 });

Mili_Botmain.tsx1 match

@ynonpβ€’Updated 6 days ago
79 // This is a no-op if nothing's changed
80 if (!isEndpointSet) {
81 await bot.api.setWebhook(req.url, {
82 secret_token: SECRET_TOKEN,
83 });

RedditScrappermain.js2 matches

@hoangtongvuβ€’Updated 6 days ago
2import moment from "npm:moment-timezone";
3
4// Reddit API credentials
5const clientId = "-ngsEqbToTa_FlVv-Uy28g";
6const clientSecret = "iE3aFgBYsZvCZmyLWOlAhI9pFAQ2-g";
9async function getAccessToken() {
10 const response = await axios.post(
11 "https://www.reddit.com/api/v1/access_token",
12 new URLSearchParams({
13 grant_type: "client_credentials", // Use client credentials flow

gordwameREADME.md5 matches

@alexweinβ€’Updated 6 days ago
8## Hono
9
10This app uses [Hono](https://hono.dev/) as the API framework. You can think of Hono as a replacement for [ExpressJS](https://expressjs.com/) that works in serverless environments like Val Town or Cloudflare Workers. If you come from Python or Ruby, Hono is also a lot like [Flask](https://github.com/pallets/flask) or [Sinatra](https://github.com/sinatra/sinatra), respectively.
11
12## Serving assets to the frontend
20### `index.html`
21
22The most complicated part of this backend API is serving index.html. In this app (like most apps) we serve it at the root, ie `GET /`.
23
24We *bootstrap* `index.html` with some initial data from the server, so that it gets dynamically injected JSON data without having to make another round-trip request to the server to get that data on the frontend. This is a common pattern for client-side rendered apps.
25
26## CRUD API Routes
27
28This app has two CRUD API routes: for reading and inserting into the messages table. They both speak JSON, which is standard. They import their functions from `/backend/database/queries.ts`. These routes are called from the React app to refresh and update data.
29
30## Errors
31
32Hono and other API frameworks have a habit of swallowing up Errors. We turn off this default behavior by re-throwing errors, because we think most of the time you'll want to see the full stack trace instead of merely "Internal Server Error". You can customize how you want errors to appear.

selectmain.ts2 matches

@salonβ€’Updated 6 days ago
887 <meta name="viewport" content="width=device-width, initial-scale=1.0">
888 <title>Character Creator - Select Race (Holographic Cards)</title>
889 <link rel="preconnect" href="https://fonts.googleapis.com">
890 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
891 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&family=Orbitron:wght@700&display=swap" rel="stylesheet">
892 <style>${css}</style>
893</head>

ArabicChef_Botmain.tsx1 match

@ynonpβ€’Updated 1 week ago
79 // This is a no-op if nothing's changed
80 if (!isEndpointSet) {
81 await bot.api.setWebhook(req.url, {
82 secret_token: SECRET_TOKEN,
83 });

vapi-minutes-db1 file match

@henrywilliamsβ€’Updated 12 hours ago

vapi-minutes-db2 file matches

@henrywilliamsβ€’Updated 14 hours ago
papimark21
socialdata
Affordable & reliable alternative to Twitter API: ➑️ Access user profiles, tweets, followers & timeline data in real-time ➑️ Monitor profiles with nearly instant alerts for new tweets, follows & profile updates ➑️ Simple integration