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/?q=api&page=537&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 25402 results for "api"(5044ms)

wahoearningDashboard.tsx4 matches

@wahobd•Updated 2 months ago
31
32 // Load tasks
33 const tasksResponse = await fetch('/api/tasks', { headers });
34 if (tasksResponse.ok) {
35 const tasksData = await tasksResponse.json();
38
39 // Load transactions
40 const transactionsResponse = await fetch('/api/payments/transactions', { headers });
41 if (transactionsResponse.ok) {
42 const transactionsData = await transactionsResponse.json();
45
46 // Load today's summary
47 const summaryResponse = await fetch('/api/tasks/today-summary', { headers });
48 if (summaryResponse.ok) {
49 const summaryData = await summaryResponse.json();
74 try {
75 const token = localStorage.getItem('authToken');
76 const response = await fetch('/api/tasks/complete', {
77 method: 'POST',
78 headers: {

wahoearningAuthPage.tsx3 matches

@wahobd•Updated 2 months ago
49 if (isAdminLogin) {
50 // Admin login
51 const response = await fetch('/api/admin/login', {
52 method: 'POST',
53 headers: { 'Content-Type': 'application/json' },
67 } else if (isLogin) {
68 // User login
69 const response = await fetch('/api/auth/login', {
70 method: 'POST',
71 headers: { 'Content-Type': 'application/json' },
85 } else {
86 // User registration
87 const response = await fetch('/api/auth/register', {
88 method: 'POST',
89 headers: { 'Content-Type': 'application/json' },

wahoearningApp.tsx2 matches

@wahobd•Updated 2 months ago
31 if (adminToken) {
32 // Check admin token validity
33 const response = await fetch('/api/admin/dashboard', {
34 headers: {
35 'Authorization': `Bearer ${adminToken}`
47 if (token) {
48 // Verify user token
49 const response = await fetch('/api/auth/verify', {
50 method: 'POST',
51 headers: {

wahoearningindex.ts6 matches

@wahobd•Updated 2 months ago
17await runMigrations();
18
19// API Routes
20app.route('/api/auth', auth);
21app.route('/api/tasks', tasks);
22app.route('/api/payments', payments);
23app.route('/api/admin', admin);
24
25// Serve static files
50 status: 'ok',
51 timestamp: new Date().toISOString(),
52 message: 'EarnBD API is running'
53 });
54});

ESVVerseGrabbermain.tsx3 matches

@spren•Updated 2 months ago
78
79const getRandomVerse = async () => {
80 const ESV_API_TOKEN = Deno.env.get("ESV_API_TOKEN");
81 const reference = getRandomVerseReference();
82 const params = new URLSearchParams({
93 "indent-psalm-doxology": "0"
94 });
95 const url = `https://api.esv.org/v3/passage/text/?${params.toString()}`;
96 const resp = await fetch(url, {
97 headers: {
98 Authorization: `Token ${ESV_API_TOKEN}`,
99 },
100 });

pale-apex-preambleREADME.md1 match

@craigz•Updated 2 months ago
73The Val.town migration maintains the same core functionality while modernizing the implementation to use Deno and Val.town's HTTP handler format.
74
75### API Usage
76
77```

Townieval-summary.ts3 matches

@wahobd•Updated 2 months ago
18 SUM(num_images) as total_images
19 FROM ${USAGE_TABLE}
20 WHERE val_id = ? AND our_api_token = 1
21 GROUP BY val_id
22 `, [valId]);
34 FROM ${INFERENCE_CALLS_TABLE} i
35 JOIN ${USAGE_TABLE} u ON i.usage_id = u.id
36 WHERE u.val_id = ? AND u.our_api_token = 1
37 GROUP BY u.val_id
38 `, [valId]);
41 const requestsResult = await sqlite.execute(`
42 SELECT * FROM ${USAGE_TABLE}
43 WHERE val_id = ? AND our_api_token = 1
44 ORDER BY timestamp DESC
45 `, [valId]);

Townieval-detail.ts1 match

@wahobd•Updated 2 months ago
18 finish_reason?: string;
19 num_images?: number;
20 our_api_token: boolean;
21}
22

TownieuseUser.tsx1 match

@wahobd•Updated 2 months ago
1import { useState, useEffect } from "react";
2
3const USER_ENDPOINT = "/api/user";
4
5export function useUser() {

Townieuser-summary.ts2 matches

@wahobd•Updated 2 months ago
20 SUM(num_images) as total_images
21 FROM ${USAGE_TABLE}
22 WHERE our_api_token = 1
23 `;
24
41 FROM ${INFERENCE_CALLS_TABLE} i
42 JOIN ${USAGE_TABLE} u ON i.usage_id = u.id
43 WHERE u.our_api_token = 1
44 `;
45

PixelPixelApiMonitor1 file match

@selfire1•Updated 9 hours ago
Regularly polls the API and messages on an error.

weatherApp1 file match

@dcm31•Updated 15 hours ago
A simple weather app with dropdown cities using Open-Meteo API
fapian
<("<) <(")> (>")>
Kapil01