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/image-url.jpg%20%22Optional%20title%22?q=api&page=1612&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 21975 results for "api"(5709ms)

FetchBasicREADME.md1 match

@dtecho•Updated 5 months ago
1# Framer Fetch: Basic
2
3A basic example of an API endpoint to use with Framer Fetch.

verseOfTheDayAppmain.tsx11 matches

@mallovelli•Updated 5 months ago
5const bibleEndpoints = [
6 { url: "/worker", name: "ASV" },
7 { url: "https://bible-api.com/?random=true&translation=bbe", name: "BBE" },
8 { url: "https://bible-api.com/?random=true&translation=darby", name: "Darby" },
9 { url: "https://bible-api.com/?random=true&translation=dra", name: "DRA" },
10 { url: "https://bible-api.com/?random=true&translation=web", name: "WEB" },
11 { url: "https://bible-api.com/?random=true&translation=ylt", name: "YLT" },
12 { url: "https://bible-api.com/?random=true&translation=oeb-cw", name: "OEB-CW" },
13 { url: "https://bible-api.com/?random=true&translation=webbe", name: "WEBBe" },
14 { url: "https://bible-api.com/?random=true&translation=oeb-us", name: "OEB-US" },
15];
16
53 });
54
55 if (!response.ok) throw new Error(`API error for ${endpoint.name}: ${response.statusText}`);
56
57 const data = await response.json();
261
262 try {
263 const response = await fetch("https://bible-api.com/?random=true&translation=asv");
264 const data = await response.json();
265
290 <title>Verse of the Day</title>
291 <meta name="viewport" content="width=device-width, initial-scale=1.0">
292 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
293 <script src="https://esm.town/v/std/catch"></script>
294 <style>
notUber

notUbernotUberConsts1 match

@vawogbemi•Updated 5 months ago
1export const INSTANTDB_APP_ID = "b63bc79a-c9f3-486f-b067-7afc402b3efc";
2export const CLERK_PUBLISHABLE_KEY = "pk_test_cGVyZmVjdC1zYWlsZmlzaC02NS5jbGVyay5hY2NvdW50cy5kZXYk";
3// GO TO https://www.val.town/v/vawogbemi/notUberMapComponent to change the google maps api key -- for some reason importing it doesn't work.

adroitIvoryEchidnamain.tsx21 matches

@hashamqureshi•Updated 5 months ago
70
71 const mapRef = useRef<HTMLDivElement>(null);
72 const mapInstanceRef = useRef<any>(null);
73 const markersRef = useRef<any[]>([]);
74 const recommendationsSectionRef = useRef<HTMLDivElement>(null);
148
149 // Map update logic remains the same
150 if (mapInstanceRef.current) {
151 mapInstanceRef.current.setView([latitude, longitude], 10);
152
153 // Add main location marker
154 const mainMarker = mapInstanceRef.current.L.marker([latitude, longitude], {
155 icon: mapInstanceRef.current.L.divIcon({
156 className: 'main-location-marker',
157 html: `<div style="background-color: ${colors.secondary}; width: 20px; height: 20px; border-radius: 50%; box-shadow: 0 0 10px rgba(0,0,0,0.2);"></div>`,
158 iconSize: [20, 20]
159 })
160 }).addTo(mapInstanceRef.current);
161 markersRef.current.push(mainMarker);
162
163 // Add recommendation markers
164 recommendationsWithDistance.forEach((rec: Recommendation) => {
165 const marker = mapInstanceRef.current.L.marker([rec.latitude, rec.longitude])
166 .addTo(mapInstanceRef.current)
167 .bindPopup(`${rec.description} (${rec.distance} km)`);
168 markersRef.current.push(marker);
178 const clearPreviousMarkers = () => {
179 markersRef.current.forEach(marker => {
180 if (mapInstanceRef.current) {
181 mapInstanceRef.current.removeLayer(marker);
182 }
183 });
187 // Modify showRecommendationOnMap to scroll and show distance
188 const showRecommendationOnMap = (rec: Recommendation) => {
189 if (mapInstanceRef.current) {
190 // Scroll to map smoothly
191 mapRef.current?.scrollIntoView({ behavior: 'smooth' });
194 markersRef.current
195 .filter(marker => !marker.options.icon?.options?.className?.includes('main-location-marker'))
196 .forEach(marker => mapInstanceRef.current.removeLayer(marker));
197
198 // Center and zoom to recommendation
199 mapInstanceRef.current.setView([rec.latitude, rec.longitude], 12);
200
201 // Add recommendation marker
202 const marker = mapInstanceRef.current.L.marker([rec.latitude, rec.longitude])
203 .addTo(mapInstanceRef.current)
204 .bindPopup(`${rec.description} (${rec.distance} km)`)
205 .openPopup();
214 const L = await import('https://esm.sh/leaflet@1.9.4/dist/leaflet.js');
215
216 if (mapRef.current && !mapInstanceRef.current) {
217 mapInstanceRef.current = L.map(mapRef.current, {
218 center: [0, 0],
219 zoom: 2,
221 });
222
223 mapInstanceRef.current.L = L; // Store L for later use
224
225 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
226 attribution: '© OpenStreetMap contributors'
227 }).addTo(mapInstanceRef.current);
228
229 // Add click event to map
230 mapInstanceRef.current.on('click', (e: any) => {
231 const { lat, lng } = e.latlng;
232 setLocation({ latitude: lat, longitude: lng });
506 />
507 <link
508 href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap"
509 rel="stylesheet"
510 />

cerebras_coderREADME.md2 matches

@Reddysumanth•Updated 5 months ago
6
71. Sign up for [Cerebras](https://cloud.cerebras.ai/)
82. Get a Cerebras API Key
93. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`

cerebras_codermain.tsx5 matches

@Reddysumanth•Updated 5 months ago
212 } catch (error) {
213 Toastify({
214 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
215 position: "center",
216 duration: 3000,
1024 };
1025 } else {
1026 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1027 const completion = await client.chat.completions.create({
1028 messages: [
1149 <meta name="viewport" content="width=device-width, initial-scale=1.0">
1150 <title>CerebrasCoder</title>
1151 <link rel="preconnect" href="https://fonts.googleapis.com" />
1152 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1153 <link
1154 href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
1155 rel="stylesheet"
1156 />
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1168
1169

APIBuilderTemplateenthusiasticPeachTapir0 matches

@dcm31•Updated 5 months ago
1export default async function (interval: Interval) {
2
3}

spotifyOauthServerserver1 match

@charmaine•Updated 5 months ago
50 </li>
51 <li>If your access token expires, we use the refresh token to get a new one.</li>
52 <li>Use your access token to make requests to the Spotify API by importing `getSpotifyToken` in your other vals.</li>
53 </ol>
54

spotifyOauthServerserver1 match

@neverstew•Updated 5 months ago
50 </li>
51 <li>If your access token expires, we use the refresh token to get a new one.</li>
52 <li>Use your access token to make requests to the Spotify API by importing `getSpotifyToken` in your other vals.</li>
53 </ol>
54

APITemplateWithSwaggerUIREADME.md1 match

@dcm31•Updated 5 months ago
1# APITemplateWithSwaggerUI

f1_scoreboard_rapid1 file match

@tldr•Updated 8 hours ago

mudEchoApi1 file match

@yakuzadave•Updated 1 day ago
rapilot330
Kapil01