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?q=api&page=1162&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 18050 results for "api"(2625ms)

cerebras_codergenerate-code1 match

@Hits005Updated 2 months ago
16 };
17 } else {
18 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
19 const completion = await client.chat.completions.create({
20 messages: [

reactHonoStarterindex.ts2 matches

@agreeUpdated 2 months ago
15app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
16
17// Add your API routes here
18// app.get("/api/data", c => c.json({ hello: "world" }));
19
20// Unwrap and rethrow Hono errors as the original error

fiberplaneHonoStartermain.tsx12 matches

@bootsUpdated 2 months ago
1import { createFiberplane, createOpenAPISpec } from "https://esm.sh/@fiberplane/hono@0.5.1";
2// If you ever run into issues importing Hono, be sure to use the npm specifier like below:
3import { Hono } from "npm:hono@4.7.0";
7
8/**
9 * `GET /api/users`
10 *
11 * A mock api route that returns a list of users
12 */
13app.get("/api/users", async (c) => {
14 return c.json({
15 data: [
27
28/**
29 * `GET /openapi.json`
30 *
31 * Returns a simplified OpenAPI spec to power the Fiberplane UI.
32 */
33app.get("/openapi.json", async (c) => {
34 const spec = createOpenAPISpec(app, {
35 info: { title: "My Hono API", version: "1.0.0" },
36 });
37 return c.json(spec);
39
40/**
41 * Mount the Fiberplane API explorer at the root.
42 * This exposes a UI to test the API.
43 */
44app.use(
45 "/*",
46 createFiberplane({
47 openapi: { url: "/openapi.json" },
48 }),
49);

fiberplaneHonoStarterREADME.md13 matches

@bootsUpdated 2 months ago
1Example Hono app with a Fiberplane API explorer.
2
3> For an example with `OpenApiHono`, see: https://www.val.town/x/fiberplane/fiberplaneHonoZodStarter
4
51. Import `@fiberplane/hono`
7 import {
8 createFiberplane,
9 createOpenAPISpec
10 } from "https://esm.sh/@fiberplane/hono@0.5.1";
11 ```
12
132. Generate a simplified API spec (if you don't already have one)
14 ```ts
15 app.get("/openapi.json", async (c) => {
16 const spec = createOpenAPISpec(app, {
17 info: { title: "My Hono API", version: "1.0.0" },
18 });
19 return c.json(spec);
21 ```
22
233. Mount the api explorer
24
25This will mount it at the root `/*`, but you can mount it to another route, like `/fp/*` if you
26are using `/` for your main app. We recommend `/` if your Hono app is an API without a frontend.
27
28 ```ts
30 "/*",
31 createFiberplane({
32 openapi: { url: "/openapi.json" },
33 }),
34 );
35 ```
36
374. Visit your Val's root route to play with the API explorer!
38
39## How it Works
40
41`createFiberplane` mounts Fiberplane on your app at the specified path, which can be used to explore the api's routes and make requests.
42Think of it like an embedded, lightweigh postman.
43
44
45If you don't have an API spec at the ready, then the `createOpenAPISpec` utility helps create a simple OpenAPI spec from all routes in the application.
46(_Note that this simple spec does not include information on expected query parameters, headers, or payloads!_)
47

iiif44tumain.tsx5 matches

@sammeltassenUpdated 2 months ago
1import { IIIFBuilder } from "npm:@iiif/builder";
2
3const privateApiUrl = "https://data.4tu.nl/v2/account/articles";
4const publicApiUrl = "https://data.4tu.nl/v2/articles";
5const iiifBaseUrl = "https://data.4tu.nl/iiif/v3/";
6
25 });
26 manifest.setSeeAlso([{
27 id: `${publicApiUrl}/${uuid}`,
28 type: "Dataset",
29 label: { "en": ["Djehuty API"] },
30 format: "application/json",
31 profile: "https://djehuty.4tu.nl/#x1-490005",
71 }
72 const token = params.get("token");
73 const metadata = await fetchJson((token ? privateApiUrl : publicApiUrl) + "/" + datasetUuid, token);
74 // return Response.json(metadata);
75 if (!metadata) {

aBeautifulMindindex.ts2 matches

@charmaineUpdated 2 months ago
12app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
13
14// Add your API routes here
15// app.get("/api/data", c => c.json({ hello: "world" }));
16
17// Unwrap and rethrow Hono errors as the original error

twitterAlertREADME.md4 matches

@Akash11Updated 2 months ago
31Refer to [Twitter's search operators](https://socialdata.gitbook.io/docs/twitter-tweets/retrieve-search-results-by-keyword#endpoint-parameters) to fine-tune your query.
32
33### 4. Test API call
34Set `isProd = false` in the code if you are testing, to ensure there are enough tweets to display. <br>
35Toggle it back to `true` when you're ready to run this cron job in production and actuall send notifications.
60
61### NOTE: Usage Limits
62This val uses the SocialData API for Twitter data:
63
64- **Proxies via Val Town's [SocialDataProxy](https://www.val.town/v/stevekrouse/socialDataProxy)**: Limited to 10 cents per day for [**Val Town Pro users**](https://www.val.town/pricing). This API is *only* for Pro users.
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.

blob_adminmain.tsx25 matches

@yutaeUpdated 2 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");
778};
779
780app.get("/api/blobs", checkAuth, async (c) => {
781 const prefix = c.req.query("prefix") || "";
782 const limit = parseInt(c.req.query("limit") || "20", 10);
787});
788
789app.get("/api/blob", checkAuth, async (c) => {
790 const key = c.req.query("key");
791 if (!key) return c.text("Missing key parameter", 400);
795});
796
797app.put("/api/blob", checkAuth, async (c) => {
798 const key = c.req.query("key");
799 if (!key) return c.text("Missing key parameter", 400);
804});
805
806app.delete("/api/blob", checkAuth, async (c) => {
807 const key = c.req.query("key");
808 if (!key) return c.text("Missing key parameter", 400);
812});
813
814app.post("/api/blob", checkAuth, async (c) => {
815 const { file, key } = await c.req.parseBody();
816 if (!file || !key) return c.text("Missing file or key", 400);

capitalMultipliersmain.tsx6 matches

@vinaybjp12Updated 2 months ago
74 <div className="popup-content">
75 <div className="popup-header">
76 <h2 className="popup-title">Capital Multipliers</h2>
77 <p className="popup-subtitle">Your Financial Growth Partner</p>
78 </div>
116 <header className="hero-section">
117 <div className="hero-content">
118 <h1 className="hero-title">Capital Multipliers</h1>
119 <p className="hero-subtitle">Transforming Investments, Maximizing Returns Since 1989</p>
120 </div>
187 <div className="contact-actions">
188 <a href="tel:+918358025813" className="contact-btn">📞 Call Now</a>
189 <a href="mailto:capitalmultipliers89@gmail.com" className="contact-btn">✉️ Email Us</a>
190 </div>
191 </section>
192
193 <footer className="site-footer">
194 <p>© 2023 Capital Multipliers. All Rights Reserved.</p>
195 </footer>
196 </div>
542 <head>
543 <meta charset="UTF-8">
544 <title>Capital Multipliers - Expert Market Analysis</title>
545 <meta name="description" content="Maximize your profits with expert share market advisory services">
546 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
547 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap" rel="stylesheet">
548 <style>${css}</style>
549 </head>

wikidataredirectormain.tsx1 match

@gUpdated 2 months ago
7 * 3. Automatically redirect to the first website if only one exists
8 *
9 * Uses Wikidata's EntityData API to fetch website information
10 */
11import { Hono } from 'npm:hono';

Apiify11 file matches

@wolfUpdated 9 hours ago

dailyQuoteAPI

@SoukyUpdated 2 days ago
Kapil01
apiv1