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=997&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 11715 results for "api"(2664ms)

5 // Verify this webhook came from our bot
6 if (
7 req.headers.get("x-telegram-bot-api-secret-token") !==
8 process.env.telegramWebhookSecret
9 ) {

likesmain.tsx1 match

@neverstewUpdated 1 year ago
26}> {
27 return fetchJSON(
28 "https://api.val.town/v1/me/likes?" + searchParams({
29 offset: offset?.toString(),
30 limit: limit?.toString(),

aliasValExamplemain.tsx1 match

@neverstewUpdated 1 year ago
4 username: "stevekrouse",
5 valName: "parentReference",
6 // for private vals, pass your val town api token
7 // token: @me.secrets.valtownToken,
8});

myApimain.tsx1 match

@moodyUpdated 1 year ago
1export function myApi(name) {
2 console.email("Yo, " + name);
3 return "hi " + name;

myApimain.tsx1 match

@omar12Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

aqimain.tsx1 match

@axelavUpdated 1 year ago
3export let aqi = async () => {
4 let res = await fetchJSON(
5 "https://api.openaq.org/v2/latest?" +
6 new URLSearchParams({
7 limit: "10",

aqimain.tsx1 match

@cfabUpdated 1 year ago
4 let pm25 = (
5 await fetchJSON(
6 "https://api.openaq.org/v2/latest?" +
7 new URLSearchParams({
8 limit: "10",

myApimain.tsx1 match

@callumk7Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}
8 fetchJSON(url, {
9 headers: {
10 "trakt-api-key": "Mock",
11 "trakt-api-version": "2",
12 },
13 });
15 for (const show of TV_SHOWS_WATCHED) {
16 const resp = await makeReqTo(
17 `https://api.trakt.tv/shows/${show}/seasons?extended=episodes`
18 );
19 const hash = cyrb53(resp);
21 const newestSeason = Math.max(...resp.map((x) => +x.number));
22 const newSsnJSON = await makeReqTo(
23 `https://api.trakt.tv/shows/${show}/seasons/${newestSeason}`
24 );
25 console.email(

wee1main.tsx1 match

@valUpdated 1 year ago
2
3export let wee1 = fetchJSON(
4 "https://api.val.town/express/@val.wee2",
5 {
6 method: "POST",

gpt-image-test

@CaptainJackUpdated 4 hours ago
测试 gpt image 的不同 api 能否满足图片生成要求

new-val-api-21 file match

@shouserUpdated 1 day ago
This is an example of using the API to create a val.
apiv1
papimark21