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=724&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 8136 results for "fetch"(1830ms)

wttrGetForecastmain.tsx2 matches

@smalldogenergy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function wttrGetForecast({
7 const wttrLocation = encodeURIComponent(location);
8 const wttrLang = encodeURIComponent(languageCode);
9 const res = await fetch(
10 `https://wttr.in/${wttrLocation}?lang=${wttrLang}&format=j1`
11 );

createQuotePostmain.tsx1 match

@canpolat•Updated 1 year ago
14 const { LemmyHttp } = await import("npm:lemmy-js-client@0.18.1");
15 let client = new LemmyHttp(`https://${instance}`, {
16 fetchFunction: fetch,
17 });
18 const quote = unusedQuotes.pop();

dohRequestIpAddrmain.tsx2 matches

@serna•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function dohRequestIpAddr(domain) {
4 let req = await fetch(`https://1.1.1.1/dns-query?name=${domain}`, {
5 headers: { "Accept": "application/dns-json" },
6 });

testcase1main.tsx2 matches

@swyx•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/swyx/fetchJSON";
2
3export let testcase1 = fetchJSON('https://api.val.town/eval/@stevekrouse.messages')
4
5// export state = () => {

starWarsmain.tsx2 matches

@axel_sb•Updated 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);

artICGetRandommain.tsx2 matches

@wilt•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const artICGetRandom = (limit: number = 1) =>
4 fetchJSON("https://api.artic.edu/api/v1/search", {
5 method: "POST",
6 headers: {

curlmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let curl = async (url: string, options?: RequestInit) => {
4 const response = await fetch(url, options);
5 const headers = Object.fromEntries(response.headers.entries());
6 const body = await response.text();

discordAPImain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3// token_type = 'Bot' | 'Bearer'
4export let discordAPI = ({path, tokenType, token}) => fetchJSON(
5 `https://discord.com/api/${path}`,
6

discordFetchmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let discordFetch = (token, route) => fetchJSON(
4 `https://discord.com/api/${route}`,
5 {

testWebhookmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let testWebhook = fetchJSON("https://api.val.town/eval/@stevekrouse.webhook", {method: "POST"})

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago