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=69&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 17846 results for "api"(1932ms)

myApi1 file match

@jacob_kettle•Updated 1 year ago

postHogAPICapture1 file match

@ianvph•Updated 1 year ago

myApi1 file match

@ollypolly•Updated 1 year ago

Gardenonindex.ts7 matches

@Llad•Updated 7 mins ago
35initDatabase();
36
37// API Routes
38// Get all plants
39app.get("/api/plants", async (c) => {
40 const plantResults = await sqlite.execute(`SELECT * FROM ${TABLE_NAME} ORDER BY id DESC`);
41 return c.json(plantResults.rows);
43
44// Get database info (for admin purposes)
45app.get("/api/admin/db", async (c) => {
46 // Get table schema
47 const schema = await sqlite.execute(`PRAGMA table_info(${TABLE_NAME})`);
63
64// Get a specific plant
65app.get("/api/plants/:id", async (c) => {
66 const id = c.req.param("id");
67 const plants = await sqlite.execute(`SELECT * FROM ${TABLE_NAME} WHERE id = ?`, [id]);
75
76// Create a new plant
77app.post("/api/plants", async (c) => {
78 const body = await c.req.json();
79
100
101// Update a plant
102app.put("/api/plants/:id", async (c) => {
103 const id = c.req.param("id");
104 const body = await c.req.json();
132
133// Delete a plant
134app.delete("/api/plants/:id", async (c) => {
135 const id = c.req.param("id");
136

fotmobindex.ts2 matches

@cemugur70•Updated 9 mins ago
38});
39
40// Analysis API endpoint
41app.post("/api/analyze", async c => {
42 try {
43 const request: AnalysisRequest = await c.req.json();
snartapi
apiry