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=1042&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 11733 results for "api"(3152ms)

starWarsmain.tsx2 matches

@hepuffinUpdated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Explore the Star Wars universe, from StarWarsAPI
4export let starWars = fetchJSON(
5 "https://swapi.dev/api/people/1/"
6);

myApimain.tsx1 match

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

textmain.tsx1 match

@andrewnUpdated 1 year ago
3export const text = (async () => {
4 let mathFact = await fetchText(
5 "http://numbersapi.com/random/math",
6 );
7 return { data: `${mathFact} ${mathFact} ${mathFact}` };

myApimain.tsx1 match

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

homemain.tsx5 matches

@axelavUpdated 1 year ago
24 const params = req.params;
25 console.log(params, req);
26 const token = process.env.DISCOGS_API_TOKEN;
27 const toLowerCaseAndSort = (list: string[]) =>
28 list.map((t) => t.toLowerCase()).sort();
84 }> =>
85 fetchJSON(
86 `https://api.discogs.com/database/search?token=${token}&q=${query}${
87 isMaster ? "&type=master" : ""
88 }`
90 const getMasterRelease = async (id: string): Promise<DiscogsRelease> =>
91 fetchJSON(
92 `https://api.discogs.com/masters/${id}?token=${token}`
93 );
94 const getMainRelease = async (id: string): Promise<DiscogsRelease> =>
95 fetchJSON(
96 `https://api.discogs.com/releases/${id}?token=${token}`
97 );
98 if (params.q) {
131 }
132 res.send(
133 "No query. Use within val town: @axelav.discogs({q: 'Boards Of Canada Geogaddi'}) or as an API endpoint: https://api.val.town/eval/@axelav.discogs?q=Boards%20of%20Canada%20Geogaddi"
134 );
135}

resultmain.tsx1 match

@ariaUpdated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let result = (await fetch('https://swapi.dev/api/people/1/')).json()

generateValCodeAPImain.tsx1 match

@andreterronUpdated 1 year ago
2import { generateValCode } from "https://esm.town/v/andreterron/generateValCode";
3
4export let generateValCodeAPI = (description: string) =>
5 generateValCode(
6 process.env.VT_OPENAI_KEY,

myApimain.tsx1 match

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

myApimain.tsx1 match

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

myApimain.tsx1 match

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

gpt-image-test

@CaptainJackUpdated 10 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