You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/?q=fetch&page=10&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 14044 results for "fetch"(4129ms)
188// Call MLB Stats API for probable pitchers
189const dateStr = date.toISOString().split("T")[0];
190const response = await fetch(
191`https://statsapi.mlb.com/api/v1/schedule?sportId=1&date=${dateStr}&hydrate=probablePitcher`,
192);
221return pitchers;
222} catch (error) {
223console.error(`❌ Error fetching probable pitchers:`, error);
224return [];
225}
465private async refreshAccessToken(): Promise<void> {
466try {
467const response = await fetch("https://api.login.yahoo.com/oauth2/get_token", {
468method: "POST",
469headers: {
530console.log(`🔍 Making request to: ${url.toString()}`);
531532const response = await fetch(url.toString(), {
533headers: {
534"Authorization": `Bearer ${this.config.access_token}`,
543544// Retry the request with new token
545const retryResponse = await fetch(url.toString(), {
546headers: {
547"Authorization": `Bearer ${this.config.access_token}`,
593// Get user's leagues using the specific game key
594const leaguesEndpoint = `/users;use_login=1/games;game_keys=${gameKey}/leagues`;
595console.log(`🔍 Fetching leagues with endpoint: ${leaguesEndpoint}`);
596const leaguesResponse = await this.makeRequest(leaguesEndpoint);
597625return leagues;
626} catch (error) {
627console.error("❌ Error fetching user leagues:", error);
628return [];
629}
735return players;
736} catch (error) {
737console.error(`Error fetching roster for team ${teamKey}:`, error);
738return [];
739}
764console.log(`📝 XML body: ${xmlBody}`);
765766const response = await fetch(`${this.baseUrl}/team/${teamKey}/roster`, {
767method: "PUT",
768headers: {
796797// Store results in Val.town's blob storage for history
798await fetch("https://api.val.town/v1/blob/scheduler_results", {
799method: "POST",
800headers: {
15// 🧠 Optional: Call your GPT API here (if you want real answers)
16// Example:
17// const response = await fetch("https://YOUR-GPT-ENDPOINT", ...)
1819// For now: respond with a success confirmation