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/$2?q=api&page=2&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"(2519ms)

Blob Storage366 words

https://docs.val.town/std/blob/
await blob.copy("myKey", "myKeyCopy"); Move. Move import { blob } from "https://esm.town/v/std/blob"; await blob.move("myKey", "myKeyNew"); Lower-level API. We provide access to the lower-level getter and setters, which are useful if you

Sections

Lower-level API

Lower-level API. We provide access to the lower-level getter and setters, which are useful if you are storing non-JSON or binary data, need to stream in your response or request

Supabase561 words

https://docs.val.town/integrations/databases/supabase/
Get your API URL and service role key. Go to your project’s Settings via the sidebar. Inside API, scroll down and copy the Project URL, and then, inside Project API

Sections

3. Get your API URL and service role key

Get your API URL and service role key. Go to your project’s Settings via the sidebar. Inside API, scroll down and copy the Project URL, and then, inside Project API

Browserbase127 words

https://docs.val.town/integrations/browserbase/
to get your Browserbase API key and remix this val. Get your free Browserbase API key at https://www.browserbase.com/ Add it to your Val Town Environment Variables as BROWSERBASE_API_KEY. Remix this

Sections

Quick start

to get your Browserbase API key and remix this val. Get your free Browserbase API key at https://www.browserbase.com/ Add it to your Val Town Environment Variables as BROWSERBASE_API_KEY. Remix this

Weather129 words

https://docs.val.town/guides/weather/
require payment and API keys. If you need something free and you’re primarily interested in weather in the United States, you can check out the NOAA weather API. Also, OpenWeatherMap

Sections

Weather data sources

require payment and API keys. If you need something free and you’re primarily interested in weather in the United States, you can check out the NOAA weather API. Also, OpenWeatherMap

OpenAI300 words

https://docs.val.town/std/openai/
questions about this page. Use OpenAI’s chat completion API with std/openai. This integration enables access to OpenAI’s language models without needing to acquire API keys. For free Val Town users,

Sections

OpenAI

questions about this page. Use OpenAI’s chat completion API with std/openai. This integration enables access to OpenAI’s language models without needing to acquire API keys. For free Val Town users,

Limits

the limitation by using your own keys: Create your own API key on OpenAI’s website. Create an environment variable named OPENAI_API_KEY. Use the OpenAI client from npm:openai: ExampleRun in Val

Interop with Node, Deno, and Browsers722 words

https://docs.val.town/guides/interop/
- Vals use the ES Module Syntax. Caveats: While we support Web Platform APIs, we also support many APIs that aren’t available in web browsers. Unlike web browsers, Deno can

Sections

Deno

variables in your local environment. Private vals can be run by setting DENO_AUTH_TOKENS. Create an API token in Val Town, and then use it for the esm.town domain: Terminal window

Browsers

- Vals use the ES Module Syntax. Caveats: While we support Web Platform APIs, we also support many APIs that aren’t available in web browsers. Unlike web browsers, Deno can

Node.js

Node.js. Using Node.js with Vals directly relies on relatively new APIs in Node.js, specifically the support for HTTP and HTTPS imports. This requires you to run Node with a the

Node.js with dnt

a bit more setup than the other options, but if you’re using Deno and NPM APIs and have more complex code, it can be a great option. You’ll need to

Express402 words

https://docs.val.town/legacy-vals/express/
this page. Deprecated. New vals should use the Web API instead, which supports a wider range of inputs & outputs. The Express API allows to run a Val as an

Sections

Express

this page. Deprecated. New vals should use the Web API instead, which supports a wider range of inputs & outputs. The Express API allows to run a Val as an

handle-val.express.val.run

handle-val.express.val.run. The Express API can be called via GET or POST. You can access the JSON-parsed POST request body via req.body: @user/postWebhookRun in Val Town ↗ export let postWebhook =

Custom Status Codes

Custom Status Codes. Like any Express server, you can respond with custom headers, and custom status codes. ExampleRun in Val Town ↗ // Visit: https://api.val.town/v1/express/vtdocs.customStatusCode. export const customStatusCode = (

HTTP99 words

https://docs.val.town/vals/http/
text. Open in ChatGPT Ask questions about this page. HTTP triggers let you expose an API or website from your file. They are built on the web-standard Request and Response

Sections

HTTP

text. Open in ChatGPT Ask questions about this page. HTTP triggers let you expose an API or website from your file. They are built on the web-standard Request and Response

Push notifications107 words

https://docs.val.town/guides/push-notifications/
that would be as easy to use as console.email and might work via Web Push API, in the meantime we recommend ntfy.sh as an easy way to send yourself push

Sections

Push notifications

that would be as easy to use as console.email and might work via Web Push API, in the meantime we recommend ntfy.sh as an easy way to send yourself push

Get a Github user196 words

https://docs.val.town/integrations/github/get-a-github-user/
this page. For example, we can get a user without passing an authentication token. GitHub API endpoints have a cURL command that you can manually translate into a fetchJSON call

Sections

Get a Github user

this page. For example, we can get a user without passing an authentication token. GitHub API endpoints have a cURL command that you can manually translate into a fetchJSON call

bloglive-reload.ts1 match

@charmaine•Updated 2 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 2 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",

HN-fetch-call2 file matches

@ImGqb•Updated 16 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