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/$%7Bart_info.art.src%7D?q=api&page=954&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 12412 results for "api"(3289ms)

buildclubProjectSearchmain.tsx2 matches

@yawnxyzUpdated 11 months ago
58);
59
60const airtableApiKey = Deno.env.get("AIRTABLE_API_KEY");
61const defaultBaseId = "app1wLB4irV14mxMU";
62const defaultTableName = "ExampleItems";
66
67async function fetchAirtableData(baseId, tableName, nameColumn, contentColumn, embeddingColumn) {
68 const base = new Airtable({ apiKey: airtableApiKey }).base(baseId);
69 const records = await base(tableName).select().all();
70 const documents = records.map(record => ({

airtablesemanticsearchmain.tsx2 matches

@yawnxyzUpdated 11 months ago
12}));
13
14const airtableApiKey = Deno.env.get("AIRTABLE_API_KEY");
15const defaultBaseId = "app1wLB4irV14mxMU";
16const defaultTableName = "ExampleItems";
19
20async function fetchAirtableData(baseId, tableName, contentColumn, embeddingColumn) {
21 const base = new Airtable({ apiKey: airtableApiKey }).base(baseId);
22 const records = await base(tableName).select().all();
23

blob_adminREADME.md1 match

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

@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

social_data_api_project3 file matches

@tsuchi_yaUpdated 2 days ago

simple-scrabble-api1 file match

@bryUpdated 6 days 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