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=fetch&page=206&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 2732 results for "fetch"(590ms)

yaycatsscholarlyLimeSlug1 match

@charmaine•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 const response = await fetch("https://api.thecatapi.com/v1/images/search");
3 const [catData] = await response.json();
4 return Response.json({ url: catData.url });

catsplsworkscholarlyLimeSlug1 match

@charmaine•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 const response = await fetch("https://api.thecatapi.com/v1/images/search");
3 const [catData] = await response.json();
4 return Response.json({ url: catData.url });

asdfkjhh_catsscholarlyLimeSlug1 match

@charmaine•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 const response = await fetch("https://api.thecatapi.com/v1/images/search");
3 const [catData] = await response.json();
4 return Response.json({ url: catData.url });

cattsssscholarlyLimeSlug1 match

@charmaine•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 const response = await fetch("https://api.thecatapi.com/v1/images/search");
3 const [catData] = await response.json();
4 return Response.json({ url: catData.url });

newCatsEveryTimescholarlyLimeSlug1 match

@charmaine•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 const response = await fetch("https://api.thecatapi.com/v1/images/search");
3 const [catData] = await response.json();
4 return Response.json({ url: catData.url });

helloeeeenewTestVal1 match

@charmaine•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 const url = new URL(req.url);
3 return fetch(new URL(url.pathname + url.search, "https://cat--ad694aca-05d7-11f0-b1bc-569c3dd06744.web.val.run/"), {
4 method: req.method,
5 headers: req.headers,

transcendentCoralOrangutanmain.tsx4 matches

@charmaine•Updated 1 month ago
14
15// React.useEffect(() => {
16// fetchGreetings();
17// }, []);
18
19// async function fetchGreetings() {
20// try {
21// const response = await client["/greetings"].get();
26// setGreetings(data);
27// } catch (e) {
28// console.error("Failed to fetch greetings:", e);
29// setError("Failed to fetch greetings. Please try again later.");
30// }
31// }

jxnReactStream4 matches

@charmaine•Updated 1 month ago
6
7export type RequestHandler = (request: Request) => Promise<Response>;
8export type DataFetcher<T> = (request: Request) => Promise<T>;
9
10// export type DataRequest<T> = Request & { data: T };
132 return api(req);
133};
134const deprecatedGetInitiaProps = (getProps: DataFetcher<any>): Middleware => async (req, res, next) => {
135 if (!getProps) return next();
136 const data = await getProps(req);
144 /** DEPRECATED: Optional API request handler for all non-GET methods */
145 api?: RequestHandler;
146 /** DEPRECATED: data fetcher to set initial props based on request */
147 getInitialProps?: DataFetcher<any>;
148}

socialDataSearchmain.tsx1 match

@charmaine•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 const url = new URL(req.url);
3 return fetch(
4 new URL(url.pathname + url.search, "https://charmaine--5ad9e364-05c3-11f0-a042-569c3dd06744.web.val.run/"),
5 {

discordWebhookmain.tsx1 match

@charmaine•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 const url = new URL(req.url);
3 return fetch(new URL(url.pathname + url.search, "https://charmaine--5ad9e364-05c3-11f0-a042-569c3dd06744.web.val.run/"), {
4 method: req.method,
5 headers: req.headers,

fetchPaginatedData2 file matches

@nbbaier•Updated 6 days ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago