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%22Image%20title%22?q=fetch&page=906&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 14351 results for "fetch"(9319ms)

MiniAppStarterindex.ts2 matches

@xppaicyber•Updated 2 months ago
47});
48
49// HTTP vals expect an exported "fetch handler"
50// This is how you "run the server" in Val Town with Hono
51export default app.fetch;

MiniAppStarterfarcaster.ts1 match

@xppaicyber•Updated 2 months ago
84
85async function sendFarcasterNotification(payload: any) {
86 return await fetch("https://api.warpcast.com/v1/frame-notifications", {
87 method: "POST",
88 headers: { "Content-Type": "application/json" },

JokeEmailmain.tsx1 match

@steliosmchs•Updated 2 months ago
1export async function jokeEmail() {
2 const response = await fetch("https://official-joke-api.appspot.com/random_joke");
3 const joke = await response.json();
4

daypoemmain.tsx1 match

@sco•Updated 2 months ago
8 day: "numeric",
9 });
10 const weather = fetch(
11 `https://api.open-meteo.com/v1/forecast?latitude=37.77&longitude=-122.42&current=temperature_2m,weather_code`,
12 ).then(res => res.json()).then(data => console.log(data.current));

cerebras_coderindex1 match

@jackyoustra•Updated 2 months ago
5async function servePublicFile(path: string): Promise<Response> {
6 const url = new URL("./public/" + path, import.meta.url);
7 const text = await (await fetch(url, {
8 headers: {
9 "User-Agent": "", // to transpile TS to JS

cerebras_coderindex1 match

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

stevekrouse_dot_comindex.tsx1 match

@shouser•Updated 2 months ago
24 if (url.pathname !== "/") {
25 const githubPagesUrl = `https://stevekrouse.github.io${url.pathname}${url.search}`;
26 const response = await fetch(
27 new Request(githubPagesUrl, {
28 method: request.method,

Efficient_loginmain.tsx4 matches

@Elohor•Updated 2 months ago
25 : { email, password };
26
27 const response = await fetch(endpoint, {
28 method: 'POST',
29 headers: {
247
248 // Exchange code for tokens
249 const tokenResponse = await fetch('https://oauth2.googleapis.com/token', {
250 method: 'POST',
251 headers: {
263 const tokens = await tokenResponse.json();
264
265 // Fetch user info
266 const userInfoResponse = await fetch(
267 `https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=${tokens.access_token}`
268 );

Apiifyscraping.ts6 matches

@wolf•Updated 2 months ago
5
6/**
7 * Fetches a URL and returns the HTML content
8 */
9export const queryUrl = tool({
15 console.log(`[QUERYING]: ${url}`);
16
17 const res = await fetch(url);
18 const html = await res.text();
19
34 console.log(`[ANALYZING]: ${url}`);
35
36 const response = await fetch(url);
37 const html = await response.text();
38
61 console.log(`[EXTRACTING SECTION]: ${sectionId} from ${url}`);
62
63 const response = await fetch(url);
64 const html = await response.text();
65
97 console.log(`[DISCOVERING LINKS]: ${url}`);
98
99 const response = await fetch(url);
100 const html = await response.text();
101
154 console.log(`[ANALYZING PATTERNS]: ${selector} for ${url}`);
155
156 const response = await fetch(url);
157 const html = await response.text();
158

spiritualJourneyAppmain.tsx9 matches

@Derams•Updated 2 months ago
51
52 useEffect(() => {
53 // Fetch username on component mount
54 const fetchUsername = async () => {
55 try {
56 const response = await fetch('/get-username');
57 const data = await response.json();
58 if (data.username) {
60 }
61 } catch (error) {
62 console.error("Failed to fetch username", error);
63 }
64 };
65 fetchUsername();
66 }, []);
67
70
71 try {
72 const response = await fetch('/save-username', {
73 method: 'POST',
74 headers: { 'Content-Type': 'application/json' },
84 const trackDailySpirit = async () => {
85 try {
86 const response = await fetch('/track', {
87 method: 'POST',
88 headers: { 'Content-Type': 'application/json' },
110
111 try {
112 const response = await fetch('/prayer-request', {
113 method: 'POST',
114 headers: { 'Content-Type': 'application/json' },
142
143 try {
144 const response = await fetch('/download-bible', {
145 method: 'POST',
146 headers: { 'Content-Type': 'application/json' },

FetchBasic2 file matches

@ther•Updated 1 week ago

GithubPRFetcher

@andybak•Updated 1 week ago