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=api&page=3&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 18778 results for "api"(1819ms)

Get a Github user196 words

https://docs.val.town/integrations/github/get-a-github-user/
this page. For example, we can get a user without passing an authentication token. GitHub API endpoints have a cURL command that you can manually translate into a fetchJSON call

Sections

Get a Github user

this page. For example, we can get a user without passing an authentication token. GitHub API endpoints have a cURL command that you can manually translate into a fetchJSON call

Runtime153 words

https://docs.val.town/reference/runtime/
so they can make HTTP requests. Vals have access to environment variables. The experimental Temporal API is enabled. Included environment. Section titled “Included environment” fetch to make HTTP requests. import

Sections

Runtime

so they can make HTTP requests. Vals have access to environment variables. The experimental Temporal API is enabled.

Slack bot513 words

https://docs.val.town/integrations/slack/bot/
build a Slack bot using vals. Vals can receive events from Slack’s Events API via the Express API. In this guide, you’ll build a bot that replies whenever it’s mentioned.

Sections

Slack bot

build a Slack bot using vals. Vals can receive events from Slack’s Events API via the Express API. In this guide, you’ll build a bot that replies whenever it’s mentioned.

1. Create a Slack app

1. Create a Slack app. Section titled “1. Create a Slack app” Visit https://api.slack.com/apps?new_app=1, create a new app From Scratch, and choose your App Name and your workspace.

Routing189 words

https://docs.val.town/vals/http/routing/
in ChatGPT Ask questions about this page. One of the coolest things about the Request/Response API is that it works with modern web frameworks, so you can use routing and

Sections

Routing

in ChatGPT Ask questions about this page. One of the coolest things about the Request/Response API is that it works with modern web frameworks, so you can use routing and

Saving data from a web page521 words

https://docs.val.town/guides/saving-data-from-a-web-page/
to interact with it. You can either use form submissions or client-side JavaScript to make API calls to Val Town. Blob storage. Section titled “Blob storage” For example, this val

Sections

Saving data from a web page

to interact with it. You can either use form submissions or client-side JavaScript to make API calls to Val Town.

Blob storage

This is a remix of the above app that uses client-side React to make the API calls: You could easily host the React part anywhere (Vercel, Netlify, etc) and have

Environment variables278 words

https://docs.val.town/reference/environment-variables/
text. Open in ChatGPT Ask questions about this page. You can store secrets, keys, and API tokens as Environment Variables via the val’s left side bar. Environment variables can be

Sections

Environment variables

text. Open in ChatGPT Ask questions about this page. You can store secrets, keys, and API tokens as Environment Variables via the val’s left side bar. Environment variables can be

Neon Postgres283 words

https://docs.val.town/integrations/databases/neon-postgres/
Open in ChatGPT Ask questions about this page. Neon provides a PostgreSQL database with an API accessible over HTTP and a JavaScript SDK. This lets you use a more conventional

Sections

Neon Postgres

Open in ChatGPT Ask questions about this page. Neon provides a PostgreSQL database with an API accessible over HTTP and a JavaScript SDK. This lets you use a more conventional

Simplified val privacy288 words

https://docs.val.town/upgrading/simplified-val-privacy/
the privacy of a Val via the UI. There is currently no way to change the privacy status of Val via the API, but we plan to add that shortly.

Sections

Upgrading

the privacy of a Val via the UI. There is currently no way to change the privacy status of Val via the API, but we plan to add that shortly.

Discord bot692 words

https://docs.val.town/integrations/discord/how-to-make-a-discord-bot-hosted-24-7-for-free-in-/
Val Town is a social website to write, run, and host JavaScript. You can create APIs, scheduled functions, email yourself, and persist small pieces of data — all from the

Sections

Step 3: Login to Val Town

Step 3: Login to Val Town. Section titled “Step 3: Login to Val Town” Val Town is a social website to write, run, and host JavaScript. You can create APIs,

Further Directions

you want. You’ll probably want to: Register a new Slash Command. Connect your bot to APIs like OpenAI’s GPT or Dall-E. Come join us in the Val Town Discord if

Vulnerability Disclosure Policy348 words

https://docs.val.town/contact-us/security/
found. In-scope domains. Section titled “In-scope domains” Val Town uses the following domains: val.town. valtown.email. api.val.town. esm.town. val.run. Subdomains of these domains are in scope for the program. Out of

Sections

In-scope domains

In-scope domains. Section titled “In-scope domains” Val Town uses the following domains: val.town. valtown.email. api.val.town. esm.town. val.run. Subdomains of these domains are in scope for the program.

osindex.ts14 matches

@dinavinter•Updated 11 hours ago
15});
16
17// Gigya API Configuration
18const GIGYA_DOMAIN = Deno.env.get("GIGYA_DOMAIN") || "accounts.eu1.gigya.com";
19const GIGYA_API_KEY = Deno.env.get("GIGYA_API_KEY") || "";
20const GIGYA_APP_KEY = Deno.env.get("GIGYA_APP_KEY") || "";
21const GIGYA_APP_SECRET = Deno.env.get("GIGYA_APP_SECRET") || "";
22
23if (!GIGYA_API_KEY || !GIGYA_APP_KEY || !GIGYA_APP_SECRET) {
24 console.warn("Missing Gigya environment variables. Some features may not work.");
25}
26
27// Direct Gigya API functions
28async function makeGigyaRequest(endpoint: string, params: Record<string, any>): Promise<any> {
29 const url = `https://${GIGYA_DOMAIN}/${endpoint}?httpStatusCodes=true`;
30
31 const body = new URLSearchParams({
32 apiKey: GIGYA_API_KEY,
33 userKey: GIGYA_APP_KEY,
34 secret: GIGYA_APP_SECRET,
50
51 if (result.errorCode !== 0) {
52 throw new Error(`Gigya API Error ${result.errorCode}: ${result.errorMessage || "Unknown error"}`);
53 }
54
394});
395
396// API Routes
397
398// Get account info
399app.get("/api/account/:uid", async (c) => {
400 try {
401 const uid = c.req.param("uid");
413
414// Search accounts
415app.get("/api/search", async (c) => {
416 try {
417 const query = c.req.query("q") || "";
430
431// Update account
432app.put("/api/account/:uid", async (c) => {
433 try {
434 const uid = c.req.param("uid");
443
444// Import account
445app.post("/api/account/import", async (c) => {
446 try {
447 const body = await c.req.json();
454
455// Get schema
456app.get("/api/schema", async (c) => {
457 try {
458 const schema = await getSchema();
464
465// Update schema
466app.put("/api/schema", async (c) => {
467 try {
468 const body = await c.req.json();
475
476// Health check
477app.get("/api/health", (c) => {
478 return c.json({
479 success: true,

Loudaily_lineup_scheduler.tsx23 matches

@jeffvincent•Updated 11 hours ago
22}
23
24export interface YahooAPIConfig {
25 access_token: string;
26 refresh_token: string;
94 }
95
96 // Initialize Yahoo Fantasy API client
97 const yahooAPI = new YahooFantasyAPIClient(tokenData, this.tokenStorage, userId);
98
99 // Get user's leagues
100 const leagues = await yahooAPI.getUserLeagues(userId);
101 console.log(`🏟️ Found ${leagues.length} leagues for user ${userId}`);
102
106
107 // Get user's team in this league
108 const teamKey = await yahooAPI.getTeamKey(userId, league.league_id);
109 if (!teamKey) {
110 throw new Error(`Could not find team key for league ${league.league_id}`);
112
113 // Schedule pitchers for today
114 const scheduleResult = await this.schedulePitchersForTeam(yahooAPI, teamKey, date);
115
116 results.leagues_processed.push({
134 }
135
136 private async schedulePitchersForTeam(yahooAPI: YahooFantasyAPIClient, teamKey: string, date: Date) {
137 // Get today's probable pitchers from MLB API
138 const probablePitchers = await this.getTodaysProbablePitchers(date);
139 console.log(`🎯 Found ${probablePitchers.length} probable pitchers for ${date.toDateString()}`);
140
141 // Get current team roster
142 const roster = await yahooAPI.getTeamRoster(teamKey);
143 console.log(`👥 Team roster has ${roster.length} players`);
144
161 for (const change of optimization.changes) {
162 try {
163 await yahooAPI.setPlayerPosition(teamKey, change.playerId, change.newPosition);
164 results.pitchers_scheduled.push(change.playerId);
165 results.changes_made.push(change);
181 ): Promise<Array<{ name: string; team: string; game_time?: string }>> {
182 try {
183 // Call MLB Stats API for probable pitchers
184 const dateStr = date.toISOString().split("T")[0];
185 const response = await fetch(
186 `https://statsapi.mlb.com/api/v1/schedule?sportId=1&date=${dateStr}&hydrate=probablePitcher`,
187 );
188
189 if (!response.ok) {
190 throw new Error(`MLB API error: ${response.status}`);
191 }
192
326}
327
328// Simplified Yahoo Fantasy API client for Val.town
329class YahooFantasyAPIClient {
330 private config: YahooAPIConfig;
331 private baseUrl = "https://fantasysports.yahooapis.com/fantasy/v2";
332 private tokenStorage: LouTokenStorage;
333 private userId: string;
334
335 constructor(config: YahooAPIConfig, tokenStorage: LouTokenStorage, userId: string) {
336 this.config = config;
337 this.tokenStorage = tokenStorage;
351 private async refreshAccessToken(): Promise<void> {
352 try {
353 const response = await fetch("https://api.login.yahoo.com/oauth2/get_token", {
354 method: "POST",
355 headers: {
419
420 if (!retryResponse.ok) {
421 throw new Error(`Yahoo API error after refresh: ${retryResponse.status} ${retryResponse.statusText}`);
422 }
423
426
427 if (!response.ok) {
428 throw new Error(`Yahoo API error: ${response.status} ${response.statusText}`);
429 }
430
513
514 async setPlayerPosition(teamKey: string, playerId: string, position: string): Promise<void> {
515 // Yahoo Fantasy API requires PUT/POST for roster changes
516 const response = await fetch(`${this.baseUrl}/teams;team_keys=${teamKey}/roster/players;player_keys=${playerId}`, {
517 method: "PUT",
558
559 // Store results in Val.town's blob storage for history
560 await fetch("https://api.val.town/v1/blob/scheduler_results", {
561 method: "POST",
562 headers: {

helloEffectHttpApi1 file match

@mattrossman•Updated 6 hours ago

html-to-pdf-api2 file matches

@prashamtrivedi•Updated 18 hours ago
HTML to PDF converter API with blob storage
apiry
snartapi