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=88&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 11381 results for "api"(639ms)

vtProjectSearch

vtProjectSearchcomponents.tsx8 matches

@dcm31•Updated 1 week ago
1063 <link rel="icon" href="https://fav.farm/👀" />
1064 <meta name="viewport" content="width=device-width, initial-scale=1" />
1065 <link rel="preconnect" href="https://fonts.googleapis.com" />
1066 <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
1067 <link
1068 href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&display=swap"
1069 rel="stylesheet"
1070 />
1080 <a href="https://val.town" className="valtown-link" style={{ marginLeft: "auto" }}>Return to Val Town</a>
1081 </h1>
1082 <div className="api-info">
1083 <details>
1084 <summary>API Access</summary>
1085 <div className="api-docs">
1086 <p>
1087 You can access search results via JSON API by adding <code>format=json</code> to your query:
1088 </p>
1089 {searchTerm
1241 <div className="search-examples">
1242 <a href="?q=fetch" className="example-link">fetch</a>
1243 <a href="?q=api" className="example-link">api</a>
1244 <a href="?q=database" className="example-link">database</a>
1245 <a href="?q=image" className="example-link">image</a>
1396 <div className="search-examples">
1397 <a href="?q=fetch" className="example-link">fetch</a>
1398 <a href="?q=api" className="example-link">api</a>
1399 <a href="?q=database" className="example-link">database</a>
1400 <a href="?q=image" className="example-link">image</a>

weatherDashboardmain.tsx1 match

@rishabhdamelay•Updated 1 week ago
11 try {
12 const response = await fetch(
13 `https://api.open-meteo.com/v1/forecast?latitude=${location.latitude}&longitude=${location.longitude}&current_weather=true&hourly=temperature_2m,relativehumidity_2m,windspeed_10m`
14 );
15 const data = await response.json();
vtProjectSearch

vtProjectSearchweb.http.tsx1 match

@dcm31•Updated 1 week ago
1import { handler } from "./api.tsx";
2import { loadTypeaheadDataIntoMemory } from "./db.ts";
3
vtProjectSearch

vtProjectSearchdeno.lock2 matches

@dcm31•Updated 1 week ago
363 },
364 "redirects": {
365 "https://esm.town/v/std/API_URL": "https://esm.town/v/std/API_URL?v=5",
366 "https://esm.town/v/stevekrouse/sqlite": "https://esm.town/v/stevekrouse/sqlite?v=13"
367 },
368 "remote": {
369 "https://docs.val.town/pagefind/pagefind.js": "43ee232b23e27fa6b00d4f71f08a165d35a824947525989c7a051843e408e0c0",
370 "https://esm.town/v/std/API_URL?v=5": "46109f905a50e32281d3ffbe7b9c8209a778290c5274d83d131fba2d26c4974d",
371 "https://esm.town/v/stevekrouse/sqlite?v=13": "3b613197e9da35db335dc2726c062c61f9247439c10a0c64c118994e200ffa46"
372 }

valsindex.html1 match

@stevekrouse•Updated 1 week ago
7 <p>
8 For when you want to link to a Val Town user's profile pic, but don't want
9 to make an API call. <a
10 href="https://www.val.town/x/stevekrouse/profile-pics"
11 >View source</a>

aqiREADME.md2 matches

@stevekrouse•Updated 1 week ago
1# AQI Alerts
2
3**Note: I recently updated the code for this to the OpenAQ v3 API and there might be bugs.**
4
5Get email alerts when AQI is unhealthy near you.
10
111. Click `Remix`
122. Change `location` (Line 4 in [main.tsx](/main.tsx#L4)) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
133. Click `Run`
14

aqiproxy.ts2 matches

@stevekrouse•Updated 1 week ago
1const TARGET_URL = "https://api.openaq.org";
2
3export default async function(req: Request): Promise<Response> {
5 return fetch(TARGET_URL + url.pathname + url.search, {
6 headers: {
7 "X-API-Key": Deno.env.get("OpenAQ_API_KEY") as string,
8 },
9 });

Notion_GCal_SyncREADME.md10 matches

@charmaine•Updated 1 week ago
11### 1. Google Calendar Setup
121. Create a Google Cloud project at https://console.cloud.google.com/
132. Enable the Google Calendar API
143. Create OAuth2 credentials (client ID and client secret)
154. Set up OAuth consent screen
165. Use the OAuth playground (https://developers.google.com/oauthplayground/) to:
17 - Authorize the Calendar API (https://www.googleapis.com/auth/calendar.readonly)
18 - Exchange authorization code for tokens
19 - Save the refresh token
21### 2. Notion Setup
221. Create a Notion integration at https://www.notion.so/my-integrations
232. Get your Notion API key
243. Create a database in Notion for meeting pages with these properties:
25 - Title (title)
305. Get the database ID from the URL (the part after the workspace name and before the question mark)
31
32### 3. SERP API Setup (for better user information)
331. Sign up for a SERP API account at https://serpapi.com/
342. Get your API key
353. Add it as an environment variable
36
40- `GOOGLE_CLIENT_SECRET`: Your Google OAuth client secret
41- `GOOGLE_REFRESH_TOKEN`: Refresh token for your Google account
42- `NOTION_API_KEY`: Your Notion API key
43- `NOTION_DATABASE_ID`: ID of the Notion database where meeting pages will be created
44- `TEAM_DOMAIN`: Your team's email domain (e.g., "val.town")
45- `SERP_API_KEY`: Your SERP API key for enhanced user information
46
47### 5. Set Cron Schedule
50## Project Structure
51- `index.ts`: Main cron job that runs daily
52- `googleCalendar.ts`: Functions for interacting with Google Calendar API
53- `notion.ts`: Functions for creating and updating Notion pages
54- `userInfo.ts`: Functions for gathering information about meeting participants
593. It identifies meetings with exactly one external participant (not from your team domain)
604. For each user meeting, it:
61 - Gathers information about the participant using their email and SERP API
62 - Creates a Notion page with meeting details and participant information
63 - Adds sections for meeting notes and action items

Notion_GCal_SyncgoogleCalendar.ts2 matches

@charmaine•Updated 1 week ago
45 }
46
47 const tokenResponse = await fetch("https://oauth2.googleapis.com/token", {
48 method: "POST",
49 headers: {
81
82 const calendarId = "primary"; // Use primary calendar
83 const url = `https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(calendarId)}/events?timeMin=${encodeURIComponent(timeMin)}&timeMax=${encodeURIComponent(timeMax)}&singleEvents=true&orderBy=startTime`;
84
85 const response = await fetch(url, {

openapimain.ts6 matches

@stevekrouse•Updated 1 week ago
1import { openapiGenerate } from "npm:openapi";
2
3export default async (req: Request) => {
5 if (url.pathname === "/") {
6 return new Response(
7 "Turn any OpenAPI spec URL into TS types! Learn more: https://www.val.town/x/stevekrouse/openapi",
8 );
9 }
12 if (url.pathname.startsWith("/types/")) {
13 targetURL = httpsify(url.pathname.replace("/types/", ""));
14 const { types } = await openapiGenerate({
15 file: targetURL,
16 });
18 }
19 targetURL = httpsify(url.pathname.slice(1));
20 const { code } = await openapiGenerate({
21 file: targetURL,
22 });
23 return new Response("import { request } from \"npm:openapi/request.js\"\n" + code, {
24 headers: {
25 "X-TypeScript-Types": `https://${url.hostname}/types/${targetURL}`,
29 } catch (e) {
30 console.log(e);
31 return new Response(`OpenAPI URL not valid: ${targetURL}`, {
32 status: 400,
33 });

mod-interview-api1 file match

@twschiller•Updated 2 hours ago

daily-advice-app1 file match

@dcm31•Updated 3 days ago
Random advice app using Advice Slip API
apiv1
papimark21