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=99&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 11494 results for "api"(1068ms)

valProfilePageUserProfile.tsx1 match

@dcm31•Updated 1 week ago
64 // Fetch both user profile data and moi config in parallel
65 const [profileResponse, config] = await Promise.all([
66 fetch(`/api/profile/${username}?page=${currentPage}`),
67 fetchMoiConfig(`https://www.val.town/x/${username}/`)
68 ]);

valProfilePagemoiConfig.tsx1 match

@dcm31•Updated 1 week ago
117 }
118
119 // Fallback: Use Val Town profile pic API
120 return `https://pic.val.run/${username}`;
121}
vtProjectSearch

vtProjectSearchstyles.tsx4 matches

@dcm31•Updated 1 week ago
782}
783
784.api-info {
785 margin-top: 10px;
786}
787
788.api-info summary {
789 cursor: pointer;
790 color: var(--primary-color);
792}
793
794.api-docs {
795 background-color: var(--code-bg);
796 padding: 10px 15px;
801}
802
803.api-docs code {
804 display: inline-block;
805 background-color: white;
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 });

gptApiTemplate2 file matches

@charmaine•Updated 7 hours ago

mod-interview-api1 file match

@twschiller•Updated 23 hours ago
apiv1
papimark21