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/$%7Burl%7D?q=api&page=977&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 12642 results for "api"(1834ms)

blob_adminREADME.md1 match

@Daniel•Updated 11 months ago
9[![](https://stevekrouse-button.express.val.run/Install)](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
12
13# TODO

telegramREADME.md3 matches

@austinm911•Updated 11 months ago
50## How it works
51
52Telegram has a lovely API.
53
541. I created a @ValTownBot via [Bot Father](https://t.me/botfather).
552. I created a [webhook](https://www.val.town/v/stevekrouse.telegramValTownBotWebhook) and [registered it with telegram](https://www.val.town/v/stevekrouse.telegramValTownBotWebhookSetup)
563. Whenever someone new messages @ValTownBot, I generate a secret and save it along with their Chat Id in @stevekrouse/telegramValTownBotSecrets (a private val), and message it back to them
574. Now whenever you call this val, it calls [`telegramValTownAPI`](https://www.val.town/v/stevekrouse.telegramValTownAPI), which looks up your Chat Id via your secret and sends you a message
58
59## Telegram Resources
71
72- [ ] Store user data in Val Town SQLite
73- [ ] Parse user data on the API side using Zod

telegrammain.tsx1 match

@austinm911•Updated 11 months ago
25
26async function telegramRequest(path, body, authorization?: string) {
27 const response = await fetch("https://stevekrouse-telegramValTownAPI.web.val.run/" + path, {
28 method: "POST",
29 body: JSON.stringify(body),

openAQLocationmain.tsx1 match

@stevekrouse•Updated 11 months ago
7}) => {
8 const { results } = await fetchJSON(
9 "https://api.openaq.org/v2/locations?"
10 + new URLSearchParams({
11 coordinates: lat.toPrecision(8) + "," + lon.toPrecision(8),

API_URLmain.tsx4 matches

@pomdtr•Updated 11 months ago
2 // try/catch prevents crashes if the script doesn't have env access
3 try {
4 return Deno.env.get("VALTOWN_API_URL");
5 } catch {}
6}
7
8export function getApiUrl(): string {
9 return envOrUndefined("VALTOWN_API_URL") ?? "https://api.val.town";
10}
11
12export const API_URL = getApiUrl();

API_URLREADME.md4 matches

@pomdtr•Updated 11 months ago
1# Val Town API URL
2
3When Val Town code is run on Val Town servers we use a local URL so we can save time by skipping a roundtrip to the public internet. However, if you want to run your vals that use our API, ie std library vals, locally, you'll want to use our public API's URL, `https://api.val.town`. We recommend importing and using `std/API_URL` whenever you use our API so that you are always using the most efficient route.
4
5## Example Usage
6
7```ts
8import { API_URL } from "https://esm.town/v/std/API_URL";
9
10const response = await fetch(`${API_URL}/v1/me`, {
11 headers: {
12 Authorization: `Bearer ${Deno.env.get("valtown")}`,

notMyAccountmain.tsx1 match

@pomdtr•Updated 11 months ago
2import { setEnv } from "https://esm.town/v/pomdtr/setEnv";
3
4setEnv("valtown", Deno.env.get("SQLITE_API_TOKEN"));
5export default handler;

react_tldrawmain.tsx1 match

@iamseeley•Updated 11 months ago
15 <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
16 <style>
17 @import url("https://fonts.googleapis.com/css2?family=Inter:wght@500;700&display=swap");
18 @import url("https://esm.sh/tldraw/tldraw.css");
19

react_tldraw_deleted_1717545567main.tsx1 match

@iamseeley•Updated 11 months ago
15 <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
16 <style>
17 @import url("https://fonts.googleapis.com/css2?family=Inter:wght@500;700&display=swap");
18 @import url("https://esm.sh/tldraw/tldraw.css");
19

warningsmain.tsx3 matches

@nws•Updated 11 months ago
1import { API } from "https://esm.town/v/nws/api";
2
3export class Warnings {
4 endpoint: string
5
6 constructor(api: API) {
7 this.endpoint = api.url + `/alerts/active?status=actual&event=`;
8 }
9

vapi-minutes-db1 file match

@henrywilliams•Updated 8 hours ago

vapi-minutes-db2 file matches

@henrywilliams•Updated 10 hours ago
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com
mux
Your friendly, neighborhood video API.