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=692&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 12013 results for "api"(1077ms)

blueskyAlertmain.tsx3 matches

@ianvUpdated 4 months ago
1import { AtpAgent } from "npm:@atproto/api@0.13.15";
2import pMap from "npm:p-map";
3
5
6const agent = new AtpAgent({
7 service: "https://public.api.bsky.app/",
8 // fetch, ideally we'd use our @std/fetch proxy here but that doesn't work and I don't know why
9});
37
38 if (!response.ok) {
39 throw new Error(`Slack API error: ${response.status} ${response.statusText}`);
40 }
41

cerebras_coderREADME.md2 matches

@silviudxUpdated 4 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`
10
11# Todos

cerebras_codermain.tsx5 matches

@silviudxUpdated 4 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

cerebras_coder_promptsmain.tsx1 match

@silviudxUpdated 4 months ago
12 },
13 {
14 prompt: "weather dashboard for nyc using open-meteo API for NYC with icons",
15 title: "Weather App",
16 code:

cerebras_coderREADME.md2 matches

@danielamahUpdated 4 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`
10
11# Todos

cerebras_codermain.tsx5 matches

@danielamahUpdated 4 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

lastfm_exporter_dbmain.tsx5 matches

@architUpdated 4 months ago
8 // Replace with your Last.fm username
9 const USERNAME = "architkhode";
10 const API_KEY = Deno.env.get("LASTFM_API_KEY");
11
12 if (!API_KEY) {
13 console.error("Last.fm API key not configured");
14 return;
15 }
32 // Fetch last played track
33 const lastfmResponse = await fetch(
34 `http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${USERNAME}&api_key=${API_KEY}&format=json&limit=1`,
35 );
36
38
39 // Log the entire response data for debugging
40 console.log("LastFM API Response:", JSON.stringify(data, null, 2));
41
42 // Extract last played track details

lastfm_exporter_dbREADME.md1 match

@architUpdated 4 months ago
1A cron Val that fetches a LastFM user's recently played track and stores it in sqlite.
2
3Requires a LastFM API key store in the env vars.

labLoginGetUsersmain.tsx1 match

@svenlaaUpdated 4 months ago
2import { sqlite } from "https://esm.town/v/std/sqlite";
3export default async function(req: Request): Promise<Response> {
4 const res = await fetch("https://api.svenlaa.com/logiverse/logs");
5 const data = await res.json();
6 const ts = new Date().getTime();

STARTER_PROMPTSmain.tsx1 match

@silviudxUpdated 4 months ago
12 },
13 {
14 prompt: "weather dashboard for nyc using open-meteo API for NYC with icons",
15 title: "Weather App",
16 code:

social_data_api_project3 file matches

@tsuchi_yaUpdated 7 hours ago

simple-scrabble-api1 file match

@bryUpdated 3 days ago
papimark21
socialdata
Affordable & reliable alternative to Twitter API: ➡️ Access user profiles, tweets, followers & timeline data in real-time ➡️ Monitor profiles with nearly instant alerts for new tweets, follows & profile updates ➡️ Simple integration