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/$%7Bsuccess?q=api&page=1037&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 11762 results for "api"(1927ms)

myApimain.tsx1 match

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

boredActivitiesmain.tsx1 match

@emcfarlaneUpdated 1 year ago
3// Activity suggestions for when you're bored
4export let boredActivities = fetchJSON(
5 "https://www.boredapi.com/api/activity"
6);

myApimain.tsx1 match

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

myApimain.tsx1 match

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

telegramWebhookEchoMessagemain.tsx1 match

@vtdocsUpdated 1 year ago
8 // Verify this webhook came from our bot
9 if (
10 req.get("x-telegram-bot-api-secret-token") !==
11 process.env.telegramWebhookSecret
12 ) {

telegramGetMemain.tsx1 match

@vtdocsUpdated 1 year ago
3export const telegramGetMe = async (botToken: string) =>
4 fetchJSON(
5 `https://api.telegram.org/bot${botToken}/getMe`,
6 );

githubGistsmain.tsx1 match

@benigeriUpdated 1 year ago
3// GitHub gists
4export let githubGists = fetchJSON(
5 "https://api.github.com/users/stevekrouse/gists"
6);

fetchBinancemain.tsx1 match

@oskeUpdated 1 year ago
2
3export let fetchBinance = (payType: string) =>
4 fetch("https://p2p.binance.com/bapi/c2c/v2/friendly/c2c/adv/search", {
5 method: "POST",
6 body: JSON.stringify({

valRunsmain.tsx2 matches

@neverstewUpdated 1 year ago
6 id: string;
7 error?: boolean;
8 source?: ("api" | "ui" | "interval" | "email")[];
9 since?: Date;
10 until?: Date;
38}> {
39 return fetchJSON(
40 `https://api.val.town/v1/vals/${id}/runs?` +
41 searchParams({
42 error: error?.toString(),

sendToTelegrammain.tsx1 match

@pomdtrUpdated 1 year ago
6 const chatID = secretToTelegramChat[secret];
7 const resp = await fetch(
8 `https://api.telegram.org/bot${process.env.telegramToken}/sendMessage?chat_id=${chatID}&text=${message}`,
9 {
10 method: "POST",

new-val-api-21 file match

@shouserUpdated 4 hours ago
This is an example of using the API to create a val.

gpt-image-test

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