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/image-url.jpg%20%22Optional%20title%22?q=fetch&page=917&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 13633 results for "fetch"(3517ms)

setmain.tsx2 matches

@stdUpdated 3 months ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import process from "node:process";
4
5export async function set(key: string, value: any) {
6 let resp = await fetch(
7 `${API_URL}/v1/vals`,
8 {

HowManyDaysUntilmain.tsx1 match

@curtcoxUpdated 3 months ago
16 if (excluded) params.append(day.toLowerCase(), 'false');
17 });
18 const response = await fetch(`?${params.toString()}`);
19 const data = await response.json();
20 setResult(data.days);

codemirrorTsdemo1 match

@tmcwUpdated 3 months ago
8 // if this script is not on that domain. Proxy it.
9 if (u.pathname === "/worker.ts") {
10 const js = await (await fetch(import.meta.resolve("./worker"), {
11 headers: {
12 "User-Agent": "None",

selarAppmain.tsx7 matches

@selarcomUpdated 3 months ago
14
15 useEffect(() => {
16 fetchLeads();
17 }, []);
18
19 const fetchLeads = async () => {
20 const response = await fetch("/leads");
21 const data = await response.json();
22 setLeads(data);
25 const handleSubmit = async (e) => {
26 e.preventDefault();
27 const response = await fetch("/leads", {
28 method: "POST",
29 headers: { "Content-Type": "application/json" },
32
33 if (response.ok) {
34 fetchLeads();
35 setNewLead({
36 name: "",
44
45 const updateLeadStatus = async (id, newStatus) => {
46 const response = await fetch(`/leads/${id}`, {
47 method: "PATCH",
48 headers: { "Content-Type": "application/json" },
51
52 if (response.ok) {
53 fetchLeads();
54 }
55 };

AlwaysHeremain.tsx4 matches

@AIWBUpdated 3 months ago
63
64 try {
65 const response = await fetch("/process-voice", {
66 method: "POST",
67 body: formData,
137 const stopConversation = async () => {
138 try {
139 const response = await fetch("/stop-conversation", {
140 method: "POST",
141 headers: { "Content-Type": "application/json" },
286 // Convert File to Blob explicitly
287 const audioBlob = await audioFile.arrayBuffer();
288 const deepgramResponse = await fetch("https://api.deepgram.com/v1/listen", {
289 method: "POST",
290 headers: {
386
387 // Eleven Labs Text to Speech
388 const elevenLabsResponse = await fetch(
389 `https://api.elevenlabs.io/v1/text-to-speech/aEO01A4wXwd1O8GPgGlF`,
390 {

cookieFetchREADME.md2 matches

@gwoods22Updated 3 months ago
1# 🍪 Cookie Fetch 🍪
2
3Simple wrapper for fetch that manages cookies in blob storage according to the responses `set-cookie` header.
2
3import { blob } from "https://esm.town/v/std/blob";
4import { fetch } from "https://esm.town/v/std/fetch";
5import * as convert from "npm:xml-js";
6

readJavascriptWeeklyRSSmain.tsx2 matches

@SkeyeUpdated 3 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export default async function readJavascriptWeeklyRss() {
4 try {
5 const response = await fetch("https://cprss.s3.amazonaws.com/javascriptweekly.com.xml");
6 const xml = await response.text();
7 return xml;

API_Get_Weather_In_Frenchmain.tsx2 matches

@SkeyeUpdated 3 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export default async function(req: Request): Promise<Response> {
7 const location = url.get("location");
8 if (url.has("location") && location) {
9 const weather = await fetchJSON(`https://wttr.in/${location}?format=j1&lang=fr`);
10 if (url.has("all")) {
11 return Response.json(weather);

InstantQueryApp1 match

@vawogbemiUpdated 3 months ago
25 const query = JSON.parse(results!);
26
27 // In a real application, you would use the query to fetch data from the database
28 // For this example, we'll just return the query itself
29 return new Response(JSON.stringify({ query, results: "Sample results would go here" }), {

FetchBasic2 file matches

@therUpdated 1 day ago

GithubPRFetcher

@andybakUpdated 4 days ago