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=121&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 13622 results for "api"(900ms)

untitled-9291index.html1 match

@maria26โ€ขUpdated 5 days ago
9 <script src="https://esm.town/v/std/catch"></script>
10 <style>
11 @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
12
13 body {

untitled-9291index.ts3 matches

@maria26โ€ขUpdated 5 days ago
43});
44
45// IDESA Chat API endpoint
46app.post("/api/chat", async c => {
47 try {
48 const body = await c.req.json();
71 return c.json({ response });
72 } catch (error) {
73 console.error("Error in chat API:", error);
74 return c.json({ error: "Failed to process your request" }, 500);
75 }

untitled-9291README.md3 matches

@maria26โ€ขUpdated 5 days ago
7```
8โ”œโ”€โ”€ backend/
9โ”‚ โ”œโ”€โ”€ index.ts # Main API entry point with Hono
10โ”‚ โ””โ”€โ”€ README.md
11โ”œโ”€โ”€ frontend/
41
42- Frontend: React, Tailwind CSS
43- Backend: Hono (API framework)
44- AI Integration: OpenAI API
45- Deployment: Val Town

dddindex.ts27 matches

@Dhanuโ€ขUpdated 5 days ago
38 .catch(console.error);
39
40// API routes
41
42// Auth routes
43app.post("/api/auth/login", async (c) => {
44 const body = await c.req.json();
45 const { email, password } = body;
58});
59
60app.post("/api/auth/register", async (c) => {
61 const body = await c.req.json();
62 const { name, email, password } = body;
75});
76
77app.get("/api/auth/me", authenticate, async (c) => {
78 const user = c.get("user");
79 return c.json({ success: true, data: user });
81
82// Property routes
83app.get("/api/properties", async (c) => {
84 const page = parseInt(c.req.query("page") || "1");
85 const limit = parseInt(c.req.query("limit") || "10");
109});
110
111app.get("/api/properties/featured", async (c) => {
112 const limit = parseInt(c.req.query("limit") || "6");
113
121});
122
123app.get("/api/properties/:id", async (c) => {
124 const id = parseInt(c.req.param("id"));
125
137});
138
139app.post("/api/properties", authenticate, agentOrAdmin, async (c) => {
140 const user = c.get("user");
141 const body = await c.req.json();
155});
156
157app.put("/api/properties/:id", authenticate, agentOrAdmin, async (c) => {
158 const id = parseInt(c.req.param("id"));
159 const user = c.get("user");
180});
181
182app.delete("/api/properties/:id", authenticate, agentOrAdmin, async (c) => {
183 const id = parseInt(c.req.param("id"));
184 const user = c.get("user");
205
206// User routes
207app.get("/api/users", authenticate, adminOnly, async (c) => {
208 try {
209 const users = await userController.getAllUsers();
215});
216
217app.get("/api/users/agents", async (c) => {
218 try {
219 const agents = await userController.getAgents();
225});
226
227app.get("/api/users/:id", authenticate, async (c) => {
228 const id = parseInt(c.req.param("id"));
229 const user = c.get("user");
247});
248
249app.put("/api/users/:id", authenticate, async (c) => {
250 const id = parseInt(c.req.param("id"));
251 const user = c.get("user");
272});
273
274app.post("/api/users/:id/change-password", authenticate, async (c) => {
275 const id = parseInt(c.req.param("id"));
276 const user = c.get("user");
313});
314
315app.delete("/api/users/:id", authenticate, adminOnly, async (c) => {
316 const id = parseInt(c.req.param("id"));
317
335
336// Inquiry routes
337app.post("/api/inquiries", async (c) => {
338 const body = await c.req.json();
339 const { propertyId, name, email, message, phone } = body;
379});
380
381app.get("/api/inquiries", authenticate, agentOrAdmin, async (c) => {
382 const user = c.get("user");
383 const page = parseInt(c.req.query("page") || "1");
395});
396
397app.get("/api/inquiries/my", authenticate, async (c) => {
398 const user = c.get("user");
399
407});
408
409app.get("/api/inquiries/:id", authenticate, agentOrAdmin, async (c) => {
410 const id = parseInt(c.req.param("id"));
411
423});
424
425app.put("/api/inquiries/:id/status", authenticate, agentOrAdmin, async (c) => {
426 const id = parseInt(c.req.param("id"));
427 const user = c.get("user");
453});
454
455app.delete("/api/inquiries/:id", authenticate, agentOrAdmin, async (c) => {
456 const id = parseInt(c.req.param("id"));
457 const user = c.get("user");
478
479// Favorite routes
480app.post("/api/favorites/:propertyId", authenticate, async (c) => {
481 const propertyId = parseInt(c.req.param("propertyId"));
482 const user = c.get("user");
500});
501
502app.delete("/api/favorites/:propertyId", authenticate, async (c) => {
503 const propertyId = parseInt(c.req.param("propertyId"));
504 const user = c.get("user");
522});
523
524app.get("/api/favorites", authenticate, async (c) => {
525 const user = c.get("user");
526
534});
535
536app.get("/api/favorites/check/:propertyId", authenticate, async (c) => {
537 const propertyId = parseInt(c.req.param("propertyId"));
538 const user = c.get("user");
552
553// Dashboard routes
554app.get("/api/dashboard", authenticate, agentOrAdmin, async (c) => {
555 const user = c.get("user");
556

untitled-3483README.md6 matches

@Satheesh_25โ€ขUpdated 5 days ago
5## Structure
6
7- `index.ts` - Main entry point and API routes using Hono framework
8- `database/` - Database setup, migrations, and queries
9
10## API Endpoints
11
12- `GET /api/categories` - Get all product categories
13- `GET /api/products` - Get products with optional filtering
14 - Query params: `featured`, `category`, `limit`, `search`
15- `GET /api/products/:slug` - Get a single product by slug
16- `GET /api/featured` - Get featured products
17
18## Page Routes

untitled-3483index.ts8 matches

@Satheesh_25โ€ขUpdated 5 days ago
30const viewSourceUrl = projectInfo.links.self.project;
31
32// API Routes
33const api = new Hono();
34
35// Get all categories
36api.get("/categories", async (c) => {
37 const categories = await getCategories();
38 return c.json(categories);
40
41// Get products with optional filtering
42api.get("/products", async (c) => {
43 const { featured, category, limit, search } = c.req.query();
44
67
68// Get a single product by slug
69api.get("/products/:slug", async (c) => {
70 const slug = c.req.param("slug");
71 const product = await getProductBySlug(slug);
79
80// Get featured products
81api.get("/featured", async (c) => {
82 const limit = c.req.query("limit");
83 const products = await getFeaturedProducts(limit ? parseInt(limit) : 6);
85});
86
87// Mount API routes
88app.route("/api", api);
89
90// Serve static files

untitled-3483index.js1 match

@Satheesh_25โ€ขUpdated 5 days ago
700
701 try {
702 const response = await fetch(`/api/products?search=${encodeURIComponent(query)}`);
703 const products = await response.json();
704

untitled-3483README.md1 match

@Satheesh_25โ€ขUpdated 5 days ago
14## Project Structure
15
16- `backend/index.ts` - Main HTTP entry point and API routes
17- `backend/database/` - Database setup and queries
18- `frontend/` - All frontend assets (HTML, CSS, JS)

dddtypes.ts2 matches

@Dhanuโ€ขUpdated 5 days ago
131}
132
133// API Response types
134export interface ApiResponse<T> {
135 success: boolean;
136 data?: T;

dddREADME.md2 matches

@Dhanuโ€ขUpdated 5 days ago
17
18- **Frontend**: React with TailwindCSS
19- **Backend**: Hono API framework on Val Town
20- **Database**: SQLite for data storage
21- **Authentication**: JWT-based authentication
71โ”‚ โ”‚ โ””โ”€โ”€ ...
72โ”‚ โ”œโ”€โ”€ utils/
73โ”‚ โ”‚ โ”œโ”€โ”€ api.ts
74โ”‚ โ”‚ โ””โ”€โ”€ helpers.ts
75โ”‚ โ”œโ”€โ”€ index.html

create-val-api-demo1 file match

@shouserโ€ขUpdated 9 hours ago

new-val-api-demo

@shouserโ€ขUpdated 10 hours ago
This is an example of using the API to create a val.
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