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/$2?q=fetch&page=1060&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 13567 results for "fetch"(1288ms)

selfDestructmain.tsx2 matches

@codemore•Updated 7 months ago
1import ValTown from "https://esm.sh/@valtown/sdk@0.22.0";
2import { fetchValInfo } from "https://esm.town/v/pomdtr/fetchValInfo?v=2";
3
4export async function selfDestruct(importMetaUrl: string) {
5 const { id } = await fetchValInfo(importMetaUrl);
6 const { vals } = new ValTown();
7

Kinopio_Get_User_Spacesmain.tsx1 match

@pketh•Updated 7 months ago
18const getSpaces = async () => {
19 const options = requestOptions({ method: "GET" });
20 const response = await fetch(`${apiHost}/user/spaces`, options);
21 const data = await response.json();
22 const spaceNames = data.map(space => space.name);

lastloginmain.tsx1 match

@olifrah•Updated 7 months ago
10 useEffect(() => {
11 const checkAuth = async () => {
12 const response = await fetch('/auth/check');
13 const data = await response.json();
14 setEmail(data.email);

strivingSilverTapirmain.tsx2 matches

@dcm31•Updated 7 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const telegramGetMe = async (botToken: string) =>
4 fetchJSON(
5 `https://api.telegram.org/bot${botToken}/getMe`,
6 );

telegramGetMemain.tsx2 matches

@dcm31•Updated 7 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const telegramGetMe = async (botToken: string) =>
4 fetchJSON(
5 `https://api.telegram.org/bot${botToken}/getMe`,
6 );

switchbot_partymain.tsx2 matches

@stevekrouse•Updated 7 months ago
76 .toString("base64");
77
78 const response = await fetch(`https://api.switch-bot.com/${path}`, {
79 headers: {
80 "Authorization": token,
244});
245
246export default app.fetch;

selfDestructmain.tsx2 matches

@peterqliu•Updated 7 months ago
1import ValTown from "https://esm.sh/@valtown/sdk@0.22.0";
2import { fetchValInfo } from "https://esm.town/v/pomdtr/fetchValInfo?v=2";
3
4export async function selfDestruct(importMetaUrl: string) {
5 const { id } = await fetchValInfo(importMetaUrl);
6 const { vals } = new ValTown();
7

fetchValInfomain.tsx1 match

@pomdtr•Updated 7 months ago
2import ValTown from "npm:@valtown/sdk";
3
4export function fetchValInfo(importMetaURL: string) {
5 const vt = new ValTown();
6 const { author, name } = extractValInfo(importMetaURL);

fetchValInfoREADME.md4 matches

@pomdtr•Updated 7 months ago
2
3```ts
4import { fetchValInfo } from "https://esm.town/v/pomdtr/fetchValInfo"
5
6const val = await fetchValInfo(import.meta.url)
7
8console.log(val.id)
11## What's the difference with `extractValInfo` ?
12
13@pomdtr/extractValInfo get metadata synchronously by analysing the val import url, while @pomdtr/fetchValInfo perform an http call to the val.town REST api.
14
15Only use `fetchValInfo` if you need some metadata that are not available from `extractValInfo`.

exaltedChocolateHamstermain.tsx1 match

@heettike•Updated 7 months ago
3export default async function scrapeBookMyShow() {
4 const url = "https://in.bookmyshow.com/explore/home/mumbai"; // Example URL, you may need to adjust this
5 const response = await fetch(url, {
6 headers: {
7 "User-Agent":

GithubPRFetcher

@andybak•Updated 2 days ago

proxiedfetch1 file match

@jayden•Updated 3 days ago