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=41&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 21386 results for "api"(6366ms)

untitled-7953Botserver.ts1 match

@KULTHX1TEAM•Updated 6 days ago
31 // This is a no-op if nothing's changed
32 if (!isEndpointSet) {
33 await bot.api.setWebhook(req.url, {
34 secret_token: SECRET_TOKEN,
35 });

Linear-to-Slack-Remindercron.ts2 matches

@charmaine•Updated 6 days ago
14
15import { getActiveReminders, updateReminder } from "./backend/database.ts";
16import { getLinearTicket } from "./backend/linearApi.ts";
17import { sendDirectMessage } from "./backend/slackApi.ts";
18import { LinearTicket, Reminder } from "./backend/types.ts";
19

Linear-to-Slack-ReminderREADME.md5 matches

@charmaine•Updated 6 days ago
231. You'll need to these environment variables:
24 - `SLACK_BOT_TOKEN` - Your Slack bot token (see Step 2 below)
25 - `LINEAR_API_KEY` - Your Linear API key (see Step 3 below)
26
27### Step 2: Create and Configure Slack App
28
291. Go to [api.slack.com/apps](https://api.slack.com/apps) and click **"Create
30 New App"**
312. Choose **"From scratch"** and name it (e.g., "Linear Reminder Bot")
55 - **Request URL:** `https://[YOUR-VALTOWN-URL]/slack/interactive`
56
57### Step 3: Get Your Linear API Key
58
591. Open Linear and click your profile picture
602. Go to **Settings** → **Account** → **Security & access**
61 - Direct link: `https://linear.app/YOUR-WORKSPACE/settings/account/security`
623. Under **"Personal API keys"**, click **"New API key"**
634. Name it something memorable (e.g., "Val Town Slack Reminder Bot")
645. Give it full permissions and team access for easiest set up
656. **Copy the key immediately** - you won't be able to see it again!
667. Add it to Val Town as the `LINEAR_API_KEY` environment variable
67
68## Usage Guide

Linear-to-Slack-ReminderslackApi.ts1 match

@charmaine•Updated 6 days ago
1import { WebClient } from "https://esm.sh/@slack/web-api@7.0.2";
2import { SlackUser } from "./types.ts";
3

blob_adminmain.tsx6 matches

@mntcloud•Updated 6 days ago
14
15// Public route without authentication
16app.get("/api/public/:id", async (c) => {
17 const key = `__public/${c.req.param("id")}`;
18 const { blob } = await import("https://esm.town/v/std/blob");
132};
133
134app.get("/api/blobs", checkAuth, async (c) => {
135 const prefix = c.req.query("prefix") || "";
136 const limit = parseInt(c.req.query("limit") || "20", 10);
141});
142
143app.get("/api/blob", checkAuth, async (c) => {
144 const key = c.req.query("key");
145 if (!key) return c.text("Missing key parameter", 400);
149});
150
151app.put("/api/blob", checkAuth, async (c) => {
152 const key = c.req.query("key");
153 if (!key) return c.text("Missing key parameter", 400);
158});
159
160app.delete("/api/blob", checkAuth, async (c) => {
161 const key = c.req.query("key");
162 if (!key) return c.text("Missing key parameter", 400);
166});
167
168app.post("/api/blob", checkAuth, async (c) => {
169 const { file, key } = await c.req.parseBody();
170 if (!file || !key) return c.text("Missing file or key", 400);

blob_adminapp.tsx19 matches

@mntcloud•Updated 6 days ago
70 const menuRef = useRef(null);
71 const isPublic = blob.key.startsWith("__public/");
72 const publicUrl = isPublic ? `${window.location.origin}/api/public/${encodeURIComponent(blob.key.slice(9))}` : null;
73
74 useEffect(() => {
234 setLoading(true);
235 try {
236 const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
237 const data = await response.json();
238 setBlobs(data);
261 setBlobContentLoading(true);
262 try {
263 const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
264 const content = await response.text();
265 setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
275 const handleSave = async () => {
276 try {
277 await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
278 method: "PUT",
279 body: editContent,
287 const handleDelete = async (key) => {
288 try {
289 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
290 setBlobs(blobs.filter(b => b.key !== key));
291 if (selectedBlob && selectedBlob.key === key) {
304 const key = `${searchPrefix}${file.name}`;
305 formData.append("key", encodeKey(key));
306 await fetch("/api/blob", { method: "POST", body: formData });
307 const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
308 setBlobs([newBlob, ...blobs]);
326 try {
327 const fullKey = `${searchPrefix}${key}`;
328 await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
329 method: "PUT",
330 body: "",
341 const handleDownload = async (key) => {
342 try {
343 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
344 const blob = await response.blob();
345 const url = window.URL.createObjectURL(blob);
360 if (newKey && newKey !== oldKey) {
361 try {
362 const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
363 const content = await response.blob();
364 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
365 method: "PUT",
366 body: content,
367 });
368 await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
369 setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
370 if (selectedBlob && selectedBlob.key === oldKey) {
380 const newKey = `__public/${key}`;
381 try {
382 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
383 const content = await response.blob();
384 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
385 method: "PUT",
386 body: content,
387 });
388 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
389 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
390 if (selectedBlob && selectedBlob.key === key) {
399 const newKey = key.slice(9); // Remove "__public/" prefix
400 try {
401 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
402 const content = await response.blob();
403 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
404 method: "PUT",
405 body: content,
406 });
407 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
408 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
409 if (selectedBlob && selectedBlob.key === key) {
554 onClick={() =>
555 copyToClipboard(
556 `${window.location.origin}/api/public/${encodeURIComponent(selectedBlob.key.slice(9))}`,
557 )}
558 className="text-blue-400 hover:text-blue-300 text-sm"
577 >
578 <img
579 src={`/api/blob?key=${encodeKey(selectedBlob.key)}`}
580 alt="Blob content"
581 className="max-w-full h-auto"

text2svgmain.tsx2 matches

@join•Updated 6 days ago
17
18 const formattedFontName = fontName.replace(/\s/g, "+");
19 const cssUrl = `https://fonts.googleapis.com/css2?family=${formattedFontName}&display=swap`;
20
21 // Use a User-Agent that requests a TTF file from Google's API.
22 const cssResponse = await fetch(cssUrl, {
23 headers: {

akjususeProject.tsx2 matches

@akj•Updated 6 days ago
2import { useAuth } from "./useAuth.tsx";
3
4const PROJECT_ENDPOINT = "/api/project";
5const FILES_ENDPOINT = "/api/project-files";
6
7export function useProject (projectId: string, branchId?: string) {

akjususeProjects.tsx1 match

@akj•Updated 6 days ago
2import { useAuth } from "./useAuth.tsx";
3
4const ENDPOINT = "/api/projects-loader";
5
6export function useProjects () {

akjususeCreateProject.tsx1 match

@akj•Updated 6 days ago
3import { useAuth } from "./useAuth.tsx";
4
5const ENDPOINT = "/api/create-project";
6
7export function useCreateProject () {

custom-domains-val-api

@nbbaier•Updated 25 mins ago

custom-domains-val-api

@stevekrouse•Updated 1 hour ago
replicate
Run AI with an API
fiberplane
Purveyors of Hono tooling, API Playground enthusiasts, and creators of 🪿 HONC 🪿 (https://honc.dev)