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=996&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 12831 results for "api"(3076ms)

telegramREADME.md3 matches

@austinm911Updated 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

@austinm911Updated 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

@stevekrouseUpdated 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

@pomdtrUpdated 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

@pomdtrUpdated 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

@pomdtrUpdated 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

@iamseeleyUpdated 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
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

@nwsUpdated 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

apimain.tsx2 matches

@nwsUpdated 11 months 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 }

vapi-minutes-db1 file match

@henrywilliamsUpdated 1 day ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 1 day 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