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/$2?q=api&page=5&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 14950 results for "api"(867ms)

Smart_Expense_TrackerExpenseForm.tsx3 matches

@gunjana_04โ€ขUpdated 9 hours ago
22 const fetchRecentExpenses = async () => {
23 try {
24 const response = await fetch('/api/expenses?limit=10');
25 const data = await response.json();
26 if (data.success) {
60
61 try {
62 const response = await fetch('/api/expenses', {
63 method: 'POST',
64 headers: {
114
115 try {
116 const response = await fetch(`/api/expenses/${expenseId}`, {
117 method: 'DELETE',
118 });

Smart_Expense_TrackerDashboard.tsx5 matches

@gunjana_04โ€ขUpdated 9 hours ago
24
25 const [monthlyReportRes, expensesRes, goalsRes, insightsRes, userRes] = await Promise.all([
26 fetch('/api/analytics/monthly-report'),
27 fetch('/api/expenses?limit=5'),
28 fetch('/api/goals'),
29 fetch('/api/analytics/insights'),
30 fetch('/api/user/profile')
31 ]);
32

Smart_Expense_Trackerindex.ts13 matches

@gunjana_04โ€ขUpdated 9 hours ago
11// Unwrap Hono errors to see original error details
12app.onError((err, c) => {
13 console.error("API Error:", err);
14 throw err;
15});
18await runMigrations();
19
20// API Routes
21app.route("/api/expenses", expenses);
22app.route("/api/goals", goals);
23app.route("/api/analytics", analytics);
24app.route("/api/user", user);
25
26// Health check
27app.get("/api/health", (c) => {
28 return c.json({
29 success: true,
30 message: "Expense Tracker API is running!",
31 timestamp: new Date().toISOString()
32 });
45 const initialDataScript = `<script>
46 window.__INITIAL_DATA__ = {
47 apiBase: '',
48 appName: 'Smart Expense Tracker',
49 version: '1.0.0'
68 <div class="mt-4 p-4 bg-blue-50 rounded">
69 <p class="text-sm text-blue-800">
70 <strong>API Status:</strong> โœ… Backend is running<br>
71 <strong>Database:</strong> โœ… Initialized<br>
72 <strong>Frontend:</strong> โŒ Not found
82// Catch-all for SPA routing
83app.get("*", async (c) => {
84 // For SPA, serve index.html for all non-API routes
85 if (!c.req.path.startsWith("/api/")) {
86 return app.fetch(new Request(new URL("/", c.req.url)));
87 }
89 return c.json({
90 success: false,
91 error: "API endpoint not found"
92 }, 404);
93});

Smart_Expense_TrackerREADME.md1 match

@gunjana_04โ€ขUpdated 9 hours ago
40โ”‚ โ”‚ โ”œโ”€โ”€ goals.ts # Goal management
41โ”‚ โ”‚ โ””โ”€โ”€ analytics.ts # Data analysis endpoints
42โ”‚ โ””โ”€โ”€ index.ts # Main API server
43โ”œโ”€โ”€ frontend/
44โ”‚ โ”œโ”€โ”€ components/

untitled-9454README.md6 matches

@Varun07โ€ขUpdated 9 hours ago
22```
23โ”œโ”€โ”€ backend/
24โ”‚ โ””โ”€โ”€ index.ts # Hono API server with auth endpoints
25โ”œโ”€โ”€ frontend/
26โ”‚ โ”œโ”€โ”€ index.html # Main HTML template
34```
35
36## API Endpoints
37
38- `POST /api/login` - Authenticate user
39- `POST /api/register` - Create new user account
40- `POST /api/logout` - End user session
41- `GET /api/auth` - Check authentication status
42
43## Database Schema

untitled-9454App.tsx3 matches

@Varun07โ€ขUpdated 9 hours ago
23 setLoading(true);
24 try {
25 const response = await fetch("/api/login", {
26 method: "POST",
27 headers: {
50 setLoading(true);
51 try {
52 const response = await fetch("/api/register", {
53 method: "POST",
54 headers: {
75 setLoading(true);
76 try {
77 await fetch("/api/logout", {
78 method: "POST",
79 });

untitled-9454index.ts4 matches

@Varun07โ€ขUpdated 9 hours ago
63
64// Login endpoint
65app.post("/api/login", async c => {
66 try {
67 const { username, password } = await c.req.json();
102
103// Register endpoint
104app.post("/api/register", async c => {
105 try {
106 const { username, password } = await c.req.json();
137
138// Logout endpoint
139app.post("/api/logout", c => {
140 deleteCookie(c, "session");
141 deleteCookie(c, "username");
144
145// Check auth status
146app.get("/api/auth", c => {
147 const sessionToken = getCookie(c, "session");
148 const username = getCookie(c, "username");

cerebras_coderstarter-prompts.js1 match

@Catspindevโ€ขUpdated 9 hours ago
12 },
13 {
14 "prompt": "weather dashboard for nyc using open-meteo API for NYC with icons",
15 "title": "Weather App",
16 "code":

cerebras_coderREADME.md2 matches

@Catspindevโ€ขUpdated 9 hours ago
8
91. Sign up for [Cerebras](https://cloud.cerebras.ai/)
102. Get a Cerebras API Key
113. Save it in your project env variable called `CEREBRAS_API_KEY`

cerebras_coderindex.ts1 match

@Catspindevโ€ขUpdated 9 hours ago
211 } catch (error) {
212 Toastify({
213 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
214 position: "center",
215 duration: 3000,

HN-fetch-call2 file matches

@ImGqbโ€ขUpdated 10 hours ago
fetch HackerNews by API

token-server1 file match

@kwhinnery_openaiโ€ขUpdated 1 day ago
Mint tokens to use with the OpenAI Realtime API for WebRTC
rapilot330
Kapil01