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=733&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 8066 results for "fetch"(1024ms)

bookReservationOnResymain.tsx7 matches

@alp•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const bookReservationOnResy = async ({
143 params.email
144 )}&password=${encodeURIComponent(params.password)}`;
145 const response = await fetch(`${RESY_API_URL}/3/auth/password`, {
146 method: "POST",
147 body: body,
165 }) => {
166 const url = `${RESY_API_URL}/3/details`;
167 const response = await fetch(url.toString(), {
168 method: "POST",
169 headers: RESY_DEFAULT_HEADERS,
190 searchParams.set("party_size", params.seats.toString());
191 searchParams.set("venue_id", params.venueId);
192 const response = await fetch(`${url}?${searchParams}`, {
193 method: "GET",
194 headers: RESY_DEFAULT_HEADERS,
210 searchParams.set("url_slug", params.slug);
211 searchParams.set("location", params.city);
212 const response = await fetch(`${url}?${searchParams}`, {
213 method: "GET",
214 headers: RESY_DEFAULT_HEADERS,
222 authToken: string;
223 }) => {
224 const response = await fetch(`${RESY_API_URL}/3/book`, {
225 method: "POST",
226 headers: {
247 venueId,
248 });
249 console.log("Fetched available slots for day", {
250 count: slots.length,
251 times: slots.map((slot) => `${slot.date.start} -> ${slot.date.end}`),

ipmain.tsx2 matches

@hanu•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/hanu/fetchJSON";
2
3export let ip = await fetchJSON("https://api.ipify.org?format=json");

geolocationmain.tsx1 match

@juliendorra•Updated 1 year ago
1export let geolocation = async (req, res) => {
2 const ip = req.options.headers["x-forwarded-for"];
3 const jsonresponse = await $stevekrouse.fetchJSON(
4 `http://ip-api.com/json/${ip}`
5 );

getCNNNewsmain.tsx2 matches

@fab1an•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function getCNNNews() {
4 const response = await fetch(
5 "https://saurav.tech/NewsAPI/everything/cnn.json"
6 );

holidaysUSmain.tsx2 matches

@dosirak•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Public holidays in the US in 2023
4export let holidaysUS = fetchJSON(
5 "https://date.nager.at/api/v3/PublicHolidays/2023/KR"
6);

fetchJavascriptWeeklyIssuesmain.tsx2 matches

@Timmy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const fetchJavascriptWeeklyIssues = fetch("https://javascriptweekly.com/issues")
4 .then((res) => {
5 const domText = res.text();

getTelAvivMobilitySpotsmain.tsx2 matches

@rustyb•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3interface APIResponse {
10 // "https://gisn.tel-aviv.gov.il/arcgis/rest/services/IView2/MapServer/860/query?where=1=1&outFields=*&f=geojson";
11 const url = "https://app.digital4grids.com/api";
12 const json_data = await fetchJSON(url);
13 return { "json_data": [] };
14}

githubUsermain.tsx2 matches

@vtdocs•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const githubUser = (async () => {
4 const username = "stevekrouse";
5 const user = await fetchJSON(
6 `https://api.github.com/users/${username}`,
7 );

honoExamplemain.tsx1 match

@jplhomer•Updated 1 year ago
4 app.get("/", (c) => c.text("Hono yes?"));
5 app.get("/yeah", (c) => c.text("Routing ok!"));
6 return app.fetch(req);
7};
8// Forked from @tmcw.honoExample

CLIBlogmain.tsx1 match

@joodaloop•Updated 1 year ago
1export const CLIBlog = (async () => {
2 // let response = await fetch(
3 // "https://example-files.online-convert.com/document/txt/example.txt",
4 // );

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago