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=379&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 7867 results for "fetch"(2444ms)

competentCoffeeTyrannosaurusmain.tsx1 match

@shivammunday•Updated 3 months ago
20
21 try {
22 const response = await fetch('/chat', {
23 method: 'POST',
24 headers: { 'Content-Type': 'application/json' },

cerebras_codermain.tsx1 match

@tonyStark•Updated 3 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
58 try {
59 // Simulate volume boost
60 const result = await fetch('/volume-boost', {
61 method: 'POST',
62 body: JSON.stringify({ amount: boostAmount })
75 try {
76 // Simulate price boost
77 const result = await fetch('/price-boost', {
78 method: 'POST',
79 body: JSON.stringify({ amount: boostAmount })

spontaneousAmaranthFinchmain.tsx1 match

@mattrw2•Updated 3 months ago
5
6export default async function(interval: Interval) {
7 const response = await fetch("https://www.sperrychalet.com/vacancy_s.html");
8 const body = await response.text();
9 const $ = cheerio.load(body);

dotcommain.tsx1 match

@blotre•Updated 3 months ago
30 if (url.pathname === "/test.json") return Response.json({ ok: true });
31 if (url.pathname !== "/")
32 return fetch(
33 `https://stevekrouse.github.io/${url.pathname}${url.search}`,
34 request as any as RequestInit,

gsheet_call_loggedmain.tsx2 matches

@rochambeau314•Updated 3 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const gsheet_call = async (service_account, sheet_id, method, action, data) => {
10 const token = await getToken(service_account, googleAuthOptions);
11 console.log(`https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`);
12 const result = fetchJSON(
13 `https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`,
14 {

cryptoVolumeTraderAdvicemain.tsx6 matches

@Sabji•Updated 3 months ago
17
18 useEffect(() => {
19 async function fetchCryptoData() {
20 try {
21 const priceResponse = await fetch('https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum,dogecoin&vs_currencies=usd&include_24hr_change=true');
22 const priceData = await priceResponse.json();
23
24 const volumeResponse = await fetch('https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=bitcoin,ethereum,dogecoin&order=market_cap_desc&per_page=3&page=1&sparkline=false&price_change_percentage=24h');
25 const volumeData = await volumeResponse.json();
26
52 setRecommendations(processedRecommendations);
53 } catch (error) {
54 console.error("Failed to fetch crypto data", error);
55 }
56 }
57
58 fetchCryptoData();
59 const interval = setInterval(fetchCryptoData, 60000); // Update every minute
60 return () => clearInterval(interval);
61 }, []);

ReminderAppmain.tsx10 matches

@Azam123•Updated 3 months ago
18
19 useEffect(() => {
20 fetchReminders();
21 }, []);
22
23 const fetchReminders = async () => {
24 try {
25 const response = await fetch('/reminders');
26 const data = await response.json();
27 setReminders(data);
28 } catch (error) {
29 console.error('Failed to fetch reminders', error);
30 }
31 };
34 e.preventDefault();
35 try {
36 const response = await fetch('/reminders', {
37 method: 'POST',
38 headers: { 'Content-Type': 'application/json' },
40 });
41 if (response.ok) {
42 fetchReminders();
43 setNewReminder({
44 title: '',
57 const toggleCompletion = async (id, currentStatus) => {
58 try {
59 const response = await fetch(`/reminders/${id}/toggle`, {
60 method: 'PATCH',
61 headers: { 'Content-Type': 'application/json' },
63 });
64 if (response.ok) {
65 fetchReminders();
66 }
67 } catch (error) {
72 const deleteReminder = async (id) => {
73 try {
74 const response = await fetch(`/reminders/${id}`, { method: 'DELETE' });
75 if (response.ok) {
76 fetchReminders();
77 }
78 } catch (error) {

cerebras_codermain.tsx1 match

@muneeb683•Updated 3 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

searchWithSerpApimain.tsx1 match

@charmaine•Updated 3 months ago
24
25 try {
26 const response = await fetch(url);
27 if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
28

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago