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/$%7BsvgDataUrl%7D?q=api&page=9&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=api

Returns an array of strings in format "username" or "username/projectName"

Found 18990 results for "api"(2858ms)

cardamonREADME.md11 matches

@connnollyโ€ขUpdated 22 hours ago
20
21- **Frontend**: React with TypeScript, TailwindCSS
22- **Backend**: Hono API framework
23- **Database**: SQLite for recipe storage
24- **AI**: OpenAI GPT-4 for intelligent recipe parsing
35โ”‚ โ”‚ โ”œโ”€โ”€ recipes.ts # Recipe CRUD operations
36โ”‚ โ”‚ โ””โ”€โ”€ parse.ts # Recipe parsing endpoints
37โ”‚ โ””โ”€โ”€ index.ts # Main API entry point
38โ”œโ”€โ”€ frontend/
39โ”‚ โ”œโ”€โ”€ components/
48```
49
50## API Endpoints
51
52- `POST /api/parse/url` - Parse recipe from URL
53- `POST /api/parse/pdf` - Parse recipe from PDF
54- `POST /api/parse/image` - Parse recipe from image
55- `GET /api/recipes` - Get all recipes
56- `POST /api/recipes` - Save a recipe
57- `GET /api/recipes/:id` - Get specific recipe
58- `PUT /api/recipes/:id` - Update recipe
59- `DELETE /api/recipes/:id` - Delete recipe
60
61## Usage

zerto-lifecycle-matrixREADME.md1 match

@captn3m0โ€ขUpdated 22 hours ago
5Generated using Val.town
6
7Relies on the Zoomin Software bundle API to fetch the data using the JSON API, and then pluck and render the HTML part.

zerto-lifecycle-matrixmain.tsx1 match

@captn3m0โ€ขUpdated 23 hours ago
1export default async function (req: Request): Promise<Response> {
2 try {
3 const response = await fetch("https://help-be.zerto.com/api/bundle/Lifecycle.Matrix.HTML/page/product_version_lifecycle_matrix_for_zerto.html");
4
5 if (!response.ok) {

Loudaily_lineup_scheduler.tsx24 matches

@jeffvincentโ€ขUpdated 23 hours ago
22}
23
24export interface YahooAPIConfig {
25 access_token: string;
26 refresh_token: string;
99 }
100
101 // Initialize Yahoo Fantasy API client
102 const yahooAPI = new YahooFantasyAPIClient(tokenData, this.tokenStorage, userId);
103
104 // Get user's leagues
105 const leagues = await yahooAPI.getUserLeagues(userId);
106 console.log(`๐ŸŸ๏ธ Found ${leagues.length} leagues for user ${userId}`);
107
111
112 // Get user's team in this league
113 const teamKey = await yahooAPI.getTeamKey(userId, league.league_id);
114 if (!teamKey) {
115 throw new Error(`Could not find team key for league ${league.league_id}`);
117
118 // Schedule pitchers for today
119 const scheduleResult = await this.schedulePitchersForTeam(yahooAPI, teamKey, date);
120
121 results.leagues_processed.push({
139 }
140
141 private async schedulePitchersForTeam(yahooAPI: YahooFantasyAPIClient, teamKey: string, date: Date) {
142 // Get today's probable pitchers from MLB API
143 const probablePitchers = await this.getTodaysProbablePitchers(date);
144 console.log(`๐ŸŽฏ Found ${probablePitchers.length} probable pitchers for ${date.toDateString()}`);
145
146 // Get current team roster
147 const roster = await yahooAPI.getTeamRoster(teamKey);
148 console.log(`๐Ÿ‘ฅ Team roster has ${roster.length} players`);
149
166 for (const change of optimization.changes) {
167 try {
168 await yahooAPI.setPlayerPosition(teamKey, change.playerId, change.newPosition);
169 results.pitchers_scheduled.push(change.playerId);
170 results.changes_made.push(change);
186 ): Promise<Array<{ name: string; team: string; game_time?: string }>> {
187 try {
188 // Call MLB Stats API for probable pitchers
189 const dateStr = date.toISOString().split("T")[0];
190 const response = await fetch(
191 `https://statsapi.mlb.com/api/v1/schedule?sportId=1&date=${dateStr}&hydrate=probablePitcher`,
192 );
193
194 if (!response.ok) {
195 throw new Error(`MLB API error: ${response.status}`);
196 }
197
440}
441
442// Simplified Yahoo Fantasy API client for Val.town
443class YahooFantasyAPIClient {
444 private config: YahooAPIConfig;
445 private baseUrl = "https://fantasysports.yahooapis.com/fantasy/v2";
446 private tokenStorage: LouTokenStorage;
447 private userId: string;
448
449 constructor(config: YahooAPIConfig, tokenStorage: LouTokenStorage, userId: string) {
450 this.config = config;
451 this.tokenStorage = tokenStorage;
465 private async refreshAccessToken(): Promise<void> {
466 try {
467 const response = await fetch("https://api.login.yahoo.com/oauth2/get_token", {
468 method: "POST",
469 headers: {
551
552 if (!retryResponse.ok) {
553 throw new Error(`Yahoo API error after refresh: ${retryResponse.status} ${retryResponse.statusText}`);
554 }
555
558
559 if (!response.ok) {
560 throw new Error(`Yahoo API error: ${response.status} ${response.statusText}`);
561 }
562
744 await this.ensureValidToken();
745
746 // Yahoo Fantasy API requires XML for roster changes
747 const dateStr = new Date().toISOString().split("T")[0];
748
776 if (!response.ok) {
777 const responseText = await response.text();
778 console.error(`โŒ Yahoo API error response: ${responseText}`);
779 throw new Error(`Failed to set player position: ${response.status} ${response.statusText}`);
780 }
796
797 // Store results in Val.town's blob storage for history
798 await fetch("https://api.val.town/v1/blob/scheduler_results", {
799 method: "POST",
800 headers: {

NewPerspctovologyAppmain.tsx2 matches

@hxseidmanโ€ขUpdated 1 day ago
1// val.js
2
3const OPENAI_API_KEY = process.env.OPENAI_API_KEY; // set this later
4
5export default async (req, res) => {
13 }
14
15 // ๐Ÿง  Optional: Call your GPT API here (if you want real answers)
16 // Example:
17 // const response = await fetch("https://YOUR-GPT-ENDPOINT", ...)

invest-trackercrypto_news_cron.tsx1 match

@samxii777โ€ขUpdated 1 day ago
9 /* 1 โ–ธ fetch 10 freshest business headlines that mention our coins */
10 const q = encodeURIComponent(COINS.slice(0, 3).join(" OR "));
11 const url = `https://newsdata.io/api/1/latest?apikey=${KEY}`
12 + `&q=${q}&language=en&size=10&category=business`;
13

untitled-6658HTTP.tsx2 matches

@MrStealer_Officalโ€ขUpdated 1 day ago
10 />
11 <link
12 href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
13 rel="stylesheet"
14 />
64 class="rounded-md w-[120px] h-[180px] object-cover flex-shrink-0"
65 height="180"
66 src="https://storage.googleapis.com/a1aa/image/da09cbc2-570f-460a-05bb-9836a9055c79.jpg"
67 width="120"
68 />

invest-trackermacro_news_daily.tsx3 matches

@samxii777โ€ขUpdated 1 day ago
1import { blob } from "https://esm.town/v/std/blob";
2const KEY = Deno.env.get("NEWSAPI");
3
4export default async function run() {
5 const query = `https://newsapi.org/v2/everything?`
6 + `q=(${
7 encodeURIComponent(`
9 AND (United States OR Australia OR Europe OR China)
10 `)
11 })&language=en&sortBy=publishedAt&pageSize=10&apiKey=${KEY}`;
12
13 const arts = (await fetch(query).then(r => r.json())).articles ?? [];

beeminder-apicall_beeminder_api.sh0 matches

@cricks_unmixed4uโ€ขUpdated 1 day ago
1#!/bin/sh
2# Write JSON payload to file
3# cat <<EOF > datapoint.json
4# {"value": 2.5, "comment": "Test from file", "goal": "walk"}
5# EOF

beeminder-apimain.tsx6 matches

@cricks_unmixed4uโ€ขUpdated 1 day ago
1// Beeminder API Handler for Val Town
2// Requires environment variables: BEEMINDER_TOKEN
3// Goal slug can be provided via environment variable BEEMINDER_GOAL_SLUG or JSON request parameter
52 const authToken = token || Deno.env.get('BEEMINDER_TOKEN');
53 const goalSlug = datapoint.goal || defaultGoalSlug || Deno.env.get('BEEMINDER_GOAL_SLUG');
54 const baseUrl = 'https://www.beeminder.com/api/v1';
55
56 if (!authToken) {
100): Promise<any> {
101 const authToken = token || Deno.env.get('BEEMINDER_TOKEN');
102 const baseUrl = 'https://www.beeminder.com/api/v1';
103
104 if (!authToken) {
176 }
177
178 const baseUrl = 'https://www.beeminder.com/api/v1';
179
180 try {
181 // Handle different API endpoints
182 switch (path) {
183 case '/':
184 return new Response(JSON.stringify({
185 message: 'Beeminder API Handler',
186 endpoints: {
187 'GET /goal': 'Get goal information (requires goal parameter in JSON body or BEEMINDER_GOAL_SLUG env var)',
Plantfo

Plantfo8 file matches

@Lladโ€ขUpdated 4 hours ago
API for AI plant info

beeminder-api4 file matches

@cricks_unmixed4uโ€ขUpdated 1 day ago
apiry
snartapi