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=296&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 3114 results for "fetch"(317ms)

spotifyAPImain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let spotifyAPI = ({token, endpoint, ...params}) => fetchJSON(
4 `https://api.spotify.com/v1/${endpoint}?${new URLSearchParams(params)}`,
5 {

runPOSTmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let runPOST = fetchJSON(
4 `https://api.val.town/v1/run/stevekrouse.add`,
5 {

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"})

hnGetMaxIdmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let hnGetMaxId = () => fetchJSON(
4 `https://hacker-news.firebaseio.com/v0/maxitem.json?print=pretty`
5)

fetchHeaders2main.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let fetchHeaders2 = Object.fromEntries(
4 (await fetch("https://swapi.dev/api/people/1/")).headers
5);

hootsuiteNasamain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function hootsuiteNasa(req: express.Request, res: express.Response) {
17 uri = decodeURIComponent(req.query.cursor);
18 }
19 var results = await fetchJSON(uri);
20 var i;
21 for (i = 0; i < results.collection.items.length; i++) {

valTownApiExampleValmain.tsx2 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let valTownApiExampleVal = (async () => {
4 const response = await fetch(
5 `https://api.val.town/v1/alias/tmcw/valTownApiExampleVal`,
6 );

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago