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%22Image%20title%22?q=api&page=1476&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 18772 results for "api"(5342ms)

laudableFuchsiaMastodonmain.tsx7 matches

@stevekrouseโ€ขUpdated 7 months ago
91 }
92
93 const REPLICATE_API_KEY = Deno.env.get("REPLICATE_API_KEY");
94
95 if (REPLICATE_API_KEY) {
96 const modelVersion = useProModel ? "black-forest-labs/flux-1.1-pro" : "black-forest-labs/flux-schnell";
97 const settings = {
98 outputFormat: "jpg",
99 outputQuality: 90,
100 megapixels: "1",
101 };
102
103 console.log("Sending initial request to Replicate...");
104 const response = await fetch(`https://api.replicate.com/v1/models/${modelVersion}/predictions`, {
105 method: "POST",
106 headers: {
107 "Content-Type": "application/json",
108 "Authorization": `Bearer ${REPLICATE_API_KEY}`,
109 },
110 body: JSON.stringify({
114 output_quality: settings.outputQuality,
115 disable_safety_checker: true,
116 megapixels: settings.megapixels,
117 },
118 }),
127 const resultResponse = await fetch(prediction.urls.get, {
128 headers: {
129 "Authorization": `Token ${REPLICATE_API_KEY}`,
130 },
131 });

laudableFuchsiaMastodonREADME.md1 match

@stevekrouseโ€ขUpdated 7 months ago
1๐Ÿ‘• **Shirtgen API Endpoint**
2
3Shirtgen lets you generate AI-powered t-shirt designs with just a prompt! ๐Ÿ–‹๏ธ Choose between the standard "Flux Schnell" model or the enhanced "Pro" model. Perfect for creating unique custom apparel in seconds! ๐Ÿš€

shirtGenScriptREADME.md1 match

@stevekrouseโ€ขUpdated 7 months ago
1๐Ÿ‘• **Shirtgen API Endpoint**
2
3Shirtgen lets you generate AI-powered t-shirt designs with just a prompt! ๐Ÿ–‹๏ธ Choose between the standard "Flux Schnell" model or the enhanced "Pro" model. Perfect for creating unique custom apparel in seconds! ๐Ÿš€

shirtGenScriptmain.tsx7 matches

@stevekrouseโ€ขUpdated 7 months ago
13 }
14
15 const REPLICATE_API_KEY = Deno.env.get("REPLICATE_API_KEY");
16
17 if (REPLICATE_API_KEY) {
18 const modelVersion = useProModel ? "black-forest-labs/flux-1.1-pro" : "black-forest-labs/flux-schnell";
19 const settings = {
20 outputFormat: "jpg",
21 outputQuality: 90,
22 megapixels: "1",
23 };
24
25 console.log("Sending initial request to Replicate...");
26 const response = await fetch(`https://api.replicate.com/v1/models/${modelVersion}/predictions`, {
27 method: "POST",
28 headers: {
29 "Content-Type": "application/json",
30 "Authorization": `Bearer ${REPLICATE_API_KEY}`,
31 },
32 body: JSON.stringify({
36 output_quality: settings.outputQuality,
37 disable_safety_checker: true,
38 megapixels: settings.megapixels,
39 },
40 }),
49 const resultResponse = await fetch(prediction.urls.get, {
50 headers: {
51 "Authorization": `Token ${REPLICATE_API_KEY}`,
52 },
53 });

shirtGenScriptREADME.md1 match

@stevekrouseโ€ขUpdated 7 months ago
1๐Ÿ‘• **Shirtgen API Endpoint**
2
3Shirtgen lets you generate AI-powered t-shirt designs with just a prompt! ๐Ÿ–‹๏ธ Choose between the standard "Flux Schnell" model or the enhanced "Pro" model. Perfect for creating unique custom apparel in seconds! ๐Ÿš€

shirtGenScriptmain.tsx7 matches

@stevekrouseโ€ขUpdated 7 months ago
13 }
14
15 const REPLICATE_API_KEY = Deno.env.get("REPLICATE_API_KEY");
16
17 if (REPLICATE_API_KEY) {
18 const modelVersion = useProModel ? "black-forest-labs/flux-1.1-pro" : "black-forest-labs/flux-schnell";
19 const settings = {
20 outputFormat: "jpg",
21 outputQuality: 90,
22 megapixels: "1",
23 };
24
25 console.log("Sending initial request to Replicate...");
26 const response = await fetch(`https://api.replicate.com/v1/models/${modelVersion}/predictions`, {
27 method: "POST",
28 headers: {
29 "Content-Type": "application/json",
30 "Authorization": `Bearer ${REPLICATE_API_KEY}`,
31 },
32 body: JSON.stringify({
36 output_quality: settings.outputQuality,
37 disable_safety_checker: true,
38 megapixels: settings.megapixels,
39 },
40 }),
49 const resultResponse = await fetch(prediction.urls.get, {
50 headers: {
51 "Authorization": `Token ${REPLICATE_API_KEY}`,
52 },
53 });

shirtGenScriptmain.tsx7 matches

@torlancoโ€ขUpdated 7 months ago
13 }
14
15 const REPLICATE_API_KEY = Deno.env.get("REPLICATE_API_KEY");
16
17 if (REPLICATE_API_KEY) {
18 const modelVersion = useProModel ? "black-forest-labs/flux-1.1-pro" : "black-forest-labs/flux-schnell";
19 const settings = {
20 outputFormat: "jpg",
21 outputQuality: 90,
22 megapixels: "1",
23 };
24
25 console.log("Sending initial request to Replicate...");
26 const response = await fetch(`https://api.replicate.com/v1/models/${modelVersion}/predictions`, {
27 method: "POST",
28 headers: {
29 "Content-Type": "application/json",
30 "Authorization": `Bearer ${REPLICATE_API_KEY}`,
31 },
32 body: JSON.stringify({
36 output_quality: settings.outputQuality,
37 disable_safety_checker: true,
38 megapixels: settings.megapixels,
39 },
40 }),
49 const resultResponse = await fetch(prediction.urls.get, {
50 headers: {
51 "Authorization": `Token ${REPLICATE_API_KEY}`,
52 },
53 });

shirtGenScriptREADME.md1 match

@torlancoโ€ขUpdated 7 months ago
1๐Ÿ‘• **Shirtgen API Endpoint**
2
3Shirtgen lets you generate AI-powered t-shirt designs with just a prompt! ๐Ÿ–‹๏ธ Choose between the standard "Flux Schnell" model or the enhanced "Pro" model. Perfect for creating unique custom apparel in seconds! ๐Ÿš€

shirtGenREADME.md2 matches

@torlancoโ€ขUpdated 7 months ago
9
10## Image Generation Sources
11- **With Replicate API Key**: Uses **Replicate Hosted Flux models** for high-quality designs.
12- **Without Replicate Key**: Falls back to a Val.town image generator for quick designs.
13
14## Requirements
15- **Optional Replicate API Key**: To use the advanced models, set `REPLICATE_API_KEY` in your environment.

sqlitemain.tsx4 matches

@alexandrephโ€ขUpdated 7 months ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { LibsqlError, type ResultSet, type Row, type TransactionMode } from "npm:@libsql/client";
3import { z } from "npm:zod";
35
36async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
50
51async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
52 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
53 method: "POST",
54 headers: {
78
79/* Val Town's Turso Proxy returns rows as an array of values
80 * Yet the LibSQL API has a Row type which behave as an array or object,
81 * ie you can access it via numerical index or string
82 */

helloEffectHttpApi1 file match

@mattrossmanโ€ขUpdated 1 hour ago

html-to-pdf-api2 file matches

@prashamtrivediโ€ขUpdated 14 hours ago
HTML to PDF converter API with blob storage
apiry
snartapi