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=597&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 11605 results for "api"(1656ms)

crmtemplatemain.tsx1 match

@juecdUpdated 3 months ago
832 <head>
833 <title>CRM</title>
834 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
835 <style>${css}</style>
836 <meta name="viewport" content="width=device-width, initial-scale=1" />

crmtemplatemain.tsx1 match

@stevekrouseUpdated 3 months ago
832 <head>
833 <title>CRM</title>
834 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
835 <style>${css}</style>
836 <meta name="viewport" content="width=device-width, initial-scale=1" />

CRMmain.tsx1 match

@stevekrouseUpdated 3 months ago
832 <head>
833 <title>🌽 Kernel CRM</title>
834 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
835 <style>${css}</style>
836 <meta name="viewport" content="width=device-width, initial-scale=1" />

CRMmain.tsx1 match

@stevekrouseUpdated 3 months ago
832 <head>
833 <title>🌽 Kernel CRM</title>
834 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
835 <style>${css}</style>
836 <meta name="viewport" content="width=device-width, initial-scale=1" />

TodoListmain.tsx2 matches

@vyatkaUpdated 3 months ago
499 <title>Task Board</title>
500 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
501 <link rel="preconnect" href="https://fonts.googleapis.com">
502 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
503 <link href="https://fonts.googleapis.com/css2?family=DM+Serif+Text:ital@0;1&family=Dancing+Script:wght@400..700&family=Jersey+10&family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Playwrite+AU+SA:wght@100..400&family=Playwrite+IE+Guides&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Rubik+Vinyl&display=swap" rel="stylesheet">
504 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" />
505 <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" rel="stylesheet" />

fetchEventsmain.tsx8 matches

@richardwu9Updated 3 months ago
11 }
12
13 // Define Luma API details
14 const apiUrl = "https://api.lu.ma/public/v1/calendar/list-events";
15 const apiHeaders = new Headers({
16 accept: "application/json",
17 "x-luma-api-key": "secret-9UQU6JqIf5YPasDzEZYAjoz6c", // Replace with your API key
18 });
19
20 try {
21 // Fetch events from Luma API
22 const response = await fetch(apiUrl, {
23 method: "GET",
24 headers: apiHeaders, // Use correct API headers here
25 });
26
30 // Check if the response is not OK
31 if (!response.ok) {
32 throw new Error(`Luma API returned status ${response.status}`);
33 }
34

terrificCoralMolemain.tsx3 matches

@richardwu9Updated 3 months ago
1export async function fetchEvents() {
2 const url = "https://api.lu.ma/public/v1/calendar/list-events";
3 const headers = {
4 accept: "application/json",
5 "x-luma-api-key": "secret-9UQU6JqIf5YPasDzEZYAjoz6c", // Replace with your actual API key
6 };
7
9 const response = await fetch(url, { method: "GET", headers });
10 const data = await response.json();
11 return data; // Return the API response
12 } catch (error) {
13 return { error: "Failed to fetch events", details: error.message };

captchamain.tsx1 match

@loadingUpdated 3 months ago
15let CHALLENGE_IMAGES: Challenge[] = [];
16
17const capitalize = (str: string) => {
18 return str.charAt(0).toUpperCase() + str.slice(1);
19};

sweetBlackHaremain.tsx1 match

@imnkUpdated 3 months ago
8 name: 'WhatsApp',
9 icon: '💬',
10 shareUrl: (text: string) => `https://api.whatsapp.com/send?text=${encodeURIComponent(text)}`
11 },
12 {

blob_adminmain.tsx25 matches

@loadingUpdated 3 months ago
73 const menuRef = useRef(null);
74 const isPublic = blob.key.startsWith("__public/");
75 const publicUrl = isPublic ? `${window.location.origin}/api/public/${encodeURIComponent(blob.key.slice(9))}` : null;
76
77 useEffect(() => {
237 setLoading(true);
238 try {
239 const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
240 const data = await response.json();
241 setBlobs(data);
264 setBlobContentLoading(true);
265 try {
266 const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
267 const content = await response.text();
268 setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
278 const handleSave = async () => {
279 try {
280 await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
281 method: "PUT",
282 body: editContent,
290 const handleDelete = async (key) => {
291 try {
292 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
293 setBlobs(blobs.filter(b => b.key !== key));
294 if (selectedBlob && selectedBlob.key === key) {
307 const key = `${searchPrefix}${file.name}`;
308 formData.append("key", encodeKey(key));
309 await fetch("/api/blob", { method: "POST", body: formData });
310 const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
311 setBlobs([newBlob, ...blobs]);
329 try {
330 const fullKey = `${searchPrefix}${key}`;
331 await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
332 method: "PUT",
333 body: "",
344 const handleDownload = async (key) => {
345 try {
346 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
347 const blob = await response.blob();
348 const url = window.URL.createObjectURL(blob);
363 if (newKey && newKey !== oldKey) {
364 try {
365 const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
366 const content = await response.blob();
367 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
368 method: "PUT",
369 body: content,
370 });
371 await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
372 setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
373 if (selectedBlob && selectedBlob.key === oldKey) {
383 const newKey = `__public/${key}`;
384 try {
385 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
386 const content = await response.blob();
387 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
388 method: "PUT",
389 body: content,
390 });
391 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
392 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
393 if (selectedBlob && selectedBlob.key === key) {
402 const newKey = key.slice(9); // Remove "__public/" prefix
403 try {
404 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
405 const content = await response.blob();
406 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
407 method: "PUT",
408 body: content,
409 });
410 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
411 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
412 if (selectedBlob && selectedBlob.key === key) {
557 onClick={() =>
558 copyToClipboard(
559 `${window.location.origin}/api/public/${encodeURIComponent(selectedBlob.key.slice(9))}`,
560 )}
561 className="text-blue-400 hover:text-blue-300 text-sm"
580 >
581 <img
582 src={`/api/blob?key=${encodeKey(selectedBlob.key)}`}
583 alt="Blob content"
584 className="max-w-full h-auto"
660
661// Public route without authentication
662app.get("/api/public/:id", async (c) => {
663 const key = `__public/${c.req.param("id")}`;
664 const { blob } = await import("https://esm.town/v/std/blob");
766};
767
768app.get("/api/blobs", checkAuth, async (c) => {
769 const prefix = c.req.query("prefix") || "";
770 const limit = parseInt(c.req.query("limit") || "20", 10);
775});
776
777app.get("/api/blob", checkAuth, async (c) => {
778 const key = c.req.query("key");
779 if (!key) return c.text("Missing key parameter", 400);
783});
784
785app.put("/api/blob", checkAuth, async (c) => {
786 const key = c.req.query("key");
787 if (!key) return c.text("Missing key parameter", 400);
792});
793
794app.delete("/api/blob", checkAuth, async (c) => {
795 const key = c.req.query("key");
796 if (!key) return c.text("Missing key parameter", 400);
800});
801
802app.post("/api/blob", checkAuth, async (c) => {
803 const { file, key } = await c.req.parseBody();
804 if (!file || !key) return c.text("Missing file or key", 400);

new-val-api-21 file match

@shouserUpdated 14 hours ago
This is an example of using the API to create a val.

gptApiTemplate2 file matches

@charmaineUpdated 1 day 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