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/$2?q=fetch&page=26&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 13344 results for "fetch"(654ms)

book-lookup-browser

book-lookup-browserindex.ts1 match

@nucky•Updated 2 days ago
218});
219
220export default app.fetch;

my-todo-mcpmain.tsx1 match

@dhanush_suvarna•Updated 2 days ago
29});
30
31export default app.fetch;
book-lookup-browser

book-lookup-browserindex.html3 matches

@nucky•Updated 2 days ago
199
200 try {
201 const response = await fetch('/api/search', {
202 method: 'POST',
203 headers: {
262
263 try {
264 const response = await fetch('/api/search-isbn', {
265 method: 'POST',
266 headers: {
334 }
335
336 const response = await fetch('/api/bulk-search', {
337 method: 'POST',
338 headers: {

hallwayEmbedPokemonindex.html4 matches

@matt_hallway•Updated 2 days ago
25
26 async function main() {
27 const count = await fetch("https://pokeapi.co/api/v2/pokemon")
28 .then(res => res.json())
29 .then(json => json.count)
30
31 const fetchPokemon = async (index) => {
32 const pokemon = await fetch(`https://pokeapi.co/api/v2/pokemon/${index}`)
33 .then(res => res.json())
34
38 btn.onclick = async () => {
39 const index = randomIntFromInterval(1, 500)
40 const pokemon = await fetchPokemon(index)
41
42 sprite.src = pokemon.sprites.front_default

hallwayEmbedPokemonserver.ts1 match

@matt_hallway•Updated 2 days ago
11);
12
13export default app.fetch;

helloStaticSitemain.ts2 matches

@matt_hallway•Updated 2 days ago
16});
17
18// HTTP vals expect an exported "fetch handler"
19// This is how you "run the server" in Val Town with Hono
20export default app.fetch;

gemini-testmain.tsx1 match

@talkbot•Updated 2 days ago
79
80 try {
81 const geminiResponse = await fetch(targetUrl, {
82 method: req.method,
83 headers: headersToGemini,

pinboardviewerindex.ts1 match

@flymaster•Updated 2 days ago
201 <div class="bg-white p-8 rounded-lg shadow-md max-w-md">
202 <h1 class="text-2xl font-bold text-red-600 mb-4">Error</h1>
203 <p class="text-gray-600 mb-4">Failed to fetch data from the pins table.</p>
204 <p class="text-sm text-gray-500">Error: ${escapeHtml(error.message)}</p>
205 <a href="/"

untitled-2689main.tsx13 matches

@wahobd•Updated 2 days ago
604 const triggerTelegramInteraction = async (chatId) => {
605 try {
606 const response = await fetch("/handle-telegram-interaction", {
607 method: "POST",
608 headers: { "Content-Type": "application/json" },
621 };
622
623 const fetchUserBalance = async () => {
624 let userId = null;
625 let isTelegramEnv = false;
674 if (userId) {
675 try {
676 const response = await fetch(`/get-balance?uid=${userId}`);
677 if (!response.ok) {
678 try {
699 }
700 } catch (error) {
701 console.error("Failed to fetch or process balance:", error.toString());
702 setBalance("Error");
703 }
704 } else {
705 console.error("User ID could not be determined for balance fetching.");
706 setBalance("--.--");
707 }
727 window.Telegram.WebApp.ready();
728 }
729 fetchUserBalance();
730 } else if (isTelegramWebAppPresent) {
731 console.log(
732 "Telegram script present, but user data not immediately available or ready() pending. Setting timeout for balance fetch.",
733 );
734 if (window.Telegram.WebApp.ready) {
735 window.Telegram.WebApp.ready();
736 }
737 scriptLoadTimeoutId = setTimeout(fetchUserBalance, 300);
738 } else {
739 console.log("Not in Telegram environment. Proceeding as web user for balance fetch.");
740 fetchUserBalance();
741 }
742 }
878 setShowSpinner(true);
879
880 const response = await fetch("/save-credentials", {
881 method: "POST",
882 headers: { "Content-Type": "application/json" },
1880 const sendActualTelegramAPIMessage = async (botToken, chatId, text, parseMode = "Markdown") => {
1881 try {
1882 const response = await fetch(`https://api.telegram.org/bot${botToken}/sendMessage`, {
1883 method: "POST",
1884 headers: { "Content-Type": "application/json" },
2190 if (confirm('Are you sure you want to unban this user?')) {
2191 try {
2192 const response = await fetch('/unban-telegram-user', {
2193 method: 'POST',
2194 headers: { 'Content-Type': 'application/json' },

proxiedfetchmain.tsx2 matches

@jayden•Updated 2 days ago
1import { fetch as proxiedFetch } from "https://esm.town/v/std/fetch";
2
3export default async function (req: Request): Promise<Response> {
28
29 try {
30 const upstream = await proxiedFetch(target, init);
31 // Stream status, statusText, headers, and body back to the client
32 return new Response(upstream.body, {

GithubPRFetcher

@andybak•Updated 1 day ago

proxiedfetch1 file match

@jayden•Updated 2 days ago