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=901&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 10974 results for "api"(1081ms)

stopDeparturesmain.tsx1 match

@kognise•Updated 1 year ago
16 const json = await fetchJSON(url, {
17 headers: {
18 apiKey: process.env.transit,
19 },
20 });

githubUsermain.tsx1 match

@hkg•Updated 1 year ago
3// Github profile
4export let githubUser = fetchJSON(
5 "https://api.github.com/users/stevekrouse"
6);

myApiAddmain.tsx1 match

@acmu•Updated 1 year ago
2let { nameList } = await import("https://esm.town/v/acmu/nameList");
3
4export async function myApiAdd(name) {
5 if (Array.isArray(nameList)) {
6 nameList.push(name);

textToImageDallemain.tsx1 match

@hootz•Updated 1 year ago
13 }[];
14 } = await fetchJSON(
15 "https://api.openai.com/v1/images/generations",
16 {
17 method: "POST",

myApimain.tsx1 match

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

myApimain.tsx1 match

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

fetchWikipediaContentmain.tsx2 matches

@fab1an•Updated 1 year ago
4 try {
5 const title = url.split("/wiki/")[1];
6 const apiUrl = `https://en.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&explaintext&format=json&origin=*&titles=${title}`;
7 const response = await fetch(apiUrl);
8 const data = await response.json();
9 const pageId = Object.keys(data.query.pages)[0];

sendMessagemain.tsx1 match

@ptn•Updated 1 year ago
2
3export async function sendMessage(ptnKey: string, message: string) {
4 await fetch("https://app.phonetonote.com/hooks/zapier", {
5 body: JSON.stringify({
6 ptn_key: ptnKey,

myApimain.tsx1 match

@benfwalla•Updated 1 year ago
1export function myApi(name) {
2 var sentence = "hi " + name;
3 console.email(sentence);

myApimain.tsx1 match

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

daily-advice-app1 file match

@dcm31•Updated 2 days ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaine•Updated 3 days ago
apiv1
papimark21