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=720&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 10968 results for "api"(880ms)

smallweb_migratedmain.tsx8 matches

@pomdtr•Updated 7 months ago
1import { createClient, type NormalizeOAS } from "npm:fets@0.8.3";
2import type openapi from "npm:smallweb@0.14.4";
3
4if (!Deno.env.get("SMALLWEB_API_URL")) {
5 throw new Error("Missing SMALLWEB_API_URL");
6}
7
8if (!Deno.env.get("SMALLWEB_API_TOKEN")) {
9 throw new Error("Missing SMALLWEB_API_TOKEN");
10}
11
12export const smallweb = createClient<NormalizeOAS<typeof openapi>>({
13 endpoint: Deno.env.get("SMALLWEB_API_URL"),
14 globalParams: {
15 headers: { Authorization: `Bearer ${Deno.env.get("SMALLWEB_API_TOKEN")}` },
16 },
17});

excaliValmain.tsx4 matches

@all•Updated 7 months ago
244 const { code, name } = await request.json();
245
246 // Create a new val using the Val Town API
247 const response = await fetch("https://api.val.town/v1/vals", {
248 method: "POST",
249 headers: {
250 "Content-Type": "application/json",
251 "Authorization": `Bearer ${Deno.env.get("VAL_TOWN_API_KEY")}`,
252 },
253 body: JSON.stringify({
290
291const css = `
292@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');
293
294body {

excaliValmain.tsx4 matches

@stevekrouse•Updated 7 months ago
244 const { code, name } = await request.json();
245
246 // Create a new val using the Val Town API
247 const response = await fetch("https://api.val.town/v1/vals", {
248 method: "POST",
249 headers: {
250 "Content-Type": "application/json",
251 "Authorization": `Bearer ${Deno.env.get("VAL_TOWN_API_KEY")}`,
252 },
253 body: JSON.stringify({
290
291const css = `
292@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');
293
294body {

blitheTomatoDragonflyREADME.md1 match

@adambuilds•Updated 7 months ago
8
91. Click `Fork`
102. Change `location` (Line 4) 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).
113. Click `Run`
12

aqiREADME.md1 match

@adambuilds•Updated 7 months ago
8
91. Click `Fork`
102. Change `location` (Line 4) 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).
113. Click `Run`
12

pushmain.tsx8 matches

@jrmann100•Updated 7 months ago
14const app = new Hono();
15
16// key format is same as web-push's generateVAPIDKeys
17const vapidDetails = {
18 url: thisWebURL(),
19 pubKey: Deno.env.get("pushVapidPublicKey"),
20 privKey: Deno.env.get("pushVapidPrivateKey"),
21};
22
23if (vapidDetails.privKey === undefined || vapidDetails.pubKey === undefined) {
24 throw new Error("You must set pubKey and privKey secrets!");
25}
60});
61
62app.get("/vapidPublicKey", (c) => c.text(vapidDetails.pubKey));
63
64app.get("/", async (c) => {
106 await storage.set(subscription);
107 if (subscription !== null) {
108 await pushSendNotification(vapidDetails, subscription, "👋");
109 return c.text("Subscribed!");
110 }
115 const subscription = await storage.get();
116 if (subscription === null) return false;
117 await pushSendNotification(vapidDetails, subscription, ...params);
118 return true;
119};

passionateBeigeButterflymain.tsx2 matches

@stevekrouse•Updated 7 months ago
27 <head>
28 <title>SQLite Explorer</title>
29 <link rel="preconnect" href="https://fonts.googleapis.com" />
30
31 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32 <link
33 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34 rel="stylesheet"
35 />

passionateBeigeButterflyREADME.md1 match

@stevekrouse•Updated 7 months ago
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans

tvshowsmain.tsx2 matches

@tmcw•Updated 7 months ago
27 for (var i = 0; i < TV_SHOWS_WATCHED.length; ++i) {
28 const show_id = TV_SHOWS_WATCHED[i]
29 const url = `https://api.themoviedb.org/3/tv/${show_id}?api_key=${process.env.tmdb_api_key}`
30 const resp = await fetch(url)
31 const show = await resp.json()
43 title: "My TV Shows",
44 link: "https://www.val.town/Glench.tvshows",
45 description: "Personal shows from tmdb api and val.town",
46 item: {
47 title: (x) =>

generateRAdioDjRssmain.tsx2 matches

@tmcw•Updated 7 months ago
5export const generateRAdioDjRss = async () => {
6 const rssItems = previousDjs.map((dj) => {
7 const djImgSrc = `https://r-a-d.io/api/dj-image/${
8 encodeURIComponent(
9 dj.djimage,
33 link: "https://r-a-d.io/",
34 description: "Informing you of when the DJ changes on r/a/dio with only a 15 minute delay!",
35 rssLink: "https://api.val.town/v1/express/pettan.generateRAdioDjRss",
36 })
37 return new Response(rssBody, { headers: { "Content-Type": "application/rss+xml" } })

daily-advice-app1 file match

@dcm31•Updated 1 day ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaine•Updated 3 days ago
mux
Your friendly, neighborhood video API.
api