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?q=api&page=1057&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 11820 results for "api"(1747ms)

referencesmain.tsx1 match

@andreterronUpdated 1 year ago
24}[]> {
25 const res = await fetchJSON(
26 "https://api.val.town/v1/me/references?" +
27 searchParams({
28 since: since?.toISOString(),

graffitiWebsitemain.tsx1 match

@andreterronUpdated 1 year ago
38 await new Promise<void>((resolve) => setTimeout(() => resolve(), 150));
39 }
40 const code = `await api(
41 @andreterron.paintGraffitiPixel,
42 ${Math.min(Math.floor(Math.random() * 64), 64)}, // x

myApimain.tsx1 match

@wondayUpdated 1 year ago
1import { name as name2 } from "https://esm.town/v/wonday/name";
2
3export function myApi(name) {
4 return `hi ${name}! my name is ${name2}`;
5}

myApimain.tsx1 match

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

myApimain.tsx1 match

@mssUpdated 1 year ago
1export function myApi(name) {
2 console.email("hello " + name);
3 return "hello " + name;

customStatusCodemain.tsx1 match

@dogaUpdated 1 year ago
1// Visit: https://api.val.town/v1/express/vtdocs.customStatusCode
2export const customStatusCode = (req: express.Request, res: express.Response) => {
3 // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418

myApimain.tsx1 match

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

quotemain.tsx1 match

@nfelgerUpdated 1 year ago
3export let quote = (async () => {
4 const quotes = await fetchJSON(
5 "https://zenquotes.io/api/random/"
6 );
7 return `"${quotes[0].q}" – ${quotes[0].a}`;

initialCommitmain.tsx2 matches

@jshawlUpdated 1 year ago
3export let initialCommit = async (org, repo) => {
4 const repoData = await fetchJSON(
5 `https://api.github.com/repos/${org}/${repo}`
6 );
7 const { created_at } = repoData;
8 const until = new Date(Date.parse(created_at) + 600).toISOString();
9 const json = await fetchJSON(
10 `https://api.github.com/repos/${org}/${repo}/commits?until=${until}`
11 );
12 return json;

getUrlContentmain.tsx1 match

@liboUpdated 1 year ago
7 const url = "https://blog.samaltman.com/how-to-be-successful";
8 const res = await fetch(
9 "https://extractus.deno.dev/extract?apikey=rn0wbHos2e73W6ghQf705bdF&type=article&url=" +
10 url
11 );

social_data_api_project3 file matches

@tsuchi_yaUpdated 8 hours ago

new-val-api-21 file match

@shouserUpdated 18 hours ago
This is an example of using the API to create a val.
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