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=95&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 25400 results for "api"(3607ms)

Townieescredit-additions.ts1 match

@eyaizer•Updated 2 weeks ago
2import { formatNumber, formatPrice, formatDate } from "../utils/formatters.ts";
3import { PaginationResult, renderPaginationControls } from "../utils/pagination.ts";
4import { CreditAddition } from "../api/credit-additions.ts";
5
6interface CreditAdditionsSummary {

hello-mcpsip.ts1 match

@emcho•Updated 2 weeks ago
27
28 // Accept the call.
29 const url = `https://api.openai.com/v1/realtime/calls/${callId}/accept`;
30 const headers = makeHeaders("application/json");
31 const body = JSON.stringify(makeSession());

hello-mcpobserver.ts1 match

@emcho•Updated 2 weeks ago
8observer.post("/:callId", async (c) => {
9 const callId = c.req.param("callId");
10 const url = `wss://api.openai.com/v1/realtime?call_id=${callId}`;
11 const ws = new WebSocket(url, { headers: makeHeaders() });
12 ws.on("open", () => {

blob_adminmain.tsx1 match

@pomdtr•Updated 2 weeks ago
20// For backwards-compatibility with the old blob-admin
21// TODO - test that more
22app.get("/api/public/:key", (c) => {
23 return blob.get("__public/" + c.req.param("key"));
24});

Townieval-summary.ts3 matches

@eyaizer•Updated 2 weeks 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

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

TownieuseUser.tsx1 match

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

Townieuser-summary.ts2 matches

@eyaizer•Updated 2 weeks 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

Townieuser-detail.ts2 matches

@eyaizer•Updated 2 weeks ago
1import { renderLayout } from "./layout.ts";
2import { formatNumber, formatPrice, formatDate, formatBoolean } from "../utils/formatters.ts";
3import { CreditAddition } from "../api/credit-additions.ts";
4
5interface UserSummaryRow {
33 finish_reason?: string;
34 num_images?: number;
35 our_api_token: boolean;
36}
37

TownieuseProject.tsx2 matches

@eyaizer•Updated 2 weeks ago
1import { useState, useEffect } from "react";
2
3const PROJECT_ENDPOINT = "/api/project";
4const FILES_ENDPOINT = "/api/project-files";
5
6export function useProject(projectId: string, branchId?: string) {

PixelPixelApiMonitor1 file match

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

weatherApp1 file match

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