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/?q=api&page=1502&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 17906 results for "api"(1500ms)

API_URLREADME.md4 matches

@pomdtr•Updated 1 year 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 1 year 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 1 year 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
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 1 year 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

apimain.tsx2 matches

@nws•Updated 1 year ago
1import { Warnings } from "https://esm.town/v/nws/warnings";
2
3export class API {
4 url: String
5 warnings: Warnings
6
7 constructor() {
8 this.url = "https://api.weather.gov";
9 this.warnings = new Warnings(this);
10 }

bicycleWeatherREADME.md1 match

@tyler71•Updated 1 year ago
1Upstream [/kingishb/blackLobster](https://www.val.town/v/kingishb/blackLobster)
2
3Why this one? Takes in a query string of lat, lon and timezone, returns a list of good biking days as an API response.
4
5

devtoolsmain.tsx2 matches

@pomdtr•Updated 1 year ago
1import { inferRequestVal } from "https://esm.town/v/andreterron/inferRequestVal";
2import { api } from "https://esm.town/v/pomdtr/api";
3
4export function devtools(handler: (req: Request) => Response | Promise<Response>, options?: {
23
24 if (pathname === "/_logs") {
25 const { id } = await api(`/v1/alias/${val.handle}/${val.name}`);
26 return Response.redirect(`https://www.val.town/settings/evaluations?val=${id}`);
27 }

sqliteExplorerAppREADME.md1 match

@zcribe•Updated 1 year ago
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans

sqliteExplorerAppmain.tsx2 matches

@zcribe•Updated 1 year ago
26 <head>
27 <title>SQLite Explorer</title>
28 <link rel="preconnect" href="https://fonts.googleapis.com" />
29
30 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
31 <link
32 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
33 rel="stylesheet"
34 />

dailyQuoteAPI

@Souky•Updated 1 day ago

HTTP

@Ncharity•Updated 1 day ago
Daily Quote API
apiry
Kapil01