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=1&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 18674 results for "api"(1297ms)

pdf-to-htmlclaude.ts9 matches

@prashamtrivedi•Updated 48 mins ago
14}
15
16interface ClaudeAPIRequest {
17 model: string;
18 max_tokens: number;
21}
22
23interface ClaudeAPIResponse {
24 content: Array<{
25 type: "text";
33
34export class ClaudeService {
35 private apiKey: string;
36
37 private anthropic;
38
39 constructor() {
40 this.apiKey = Deno.env.get("ANTHROPIC_API_KEY") || "";
41 if (!this.apiKey) {
42 throw new Error("ANTHROPIC_API_KEY environment variable is required");
43 }
44 this.anthropic = new Anthropic(this.apiKey);
45 }
46 async exctractInvoiceHtml(
120 };
121 } catch (error) {
122 throw new Error(`Claude API request failed: ${error instanceof Error ? error.message : String(error)}`);
123 }
124 }
205 };
206 } catch (error) {
207 throw new Error(`Claude API request failed: ${error instanceof Error ? error.message : String(error)}`);
208 }
209 }

Townieval-summary.ts3 matches

@bipin0005•Updated 1 hour 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

@bipin0005•Updated 1 hour ago
18 finish_reason?: string;
19 num_images?: number;
20 our_api_token: boolean;
21}
22

TownieuseUser.tsx1 match

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

Townieuser-summary.ts2 matches

@bipin0005•Updated 1 hour 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

@bipin0005•Updated 1 hour 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

@bipin0005•Updated 1 hour 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) {

TownieuseProjects.tsx1 match

@bipin0005•Updated 1 hour ago
1import { useState, useEffect } from "react";
2
3const ENDPOINT = "/api/projects-loader";
4
5export function useProjects() {

TownieuseCreditBalance.tsx1 match

@bipin0005•Updated 1 hour ago
8 const fetchBalance = async () => {
9 try {
10 const response = await fetch("/api/credit-balance");
11 if (response.ok) {
12 const data = await response.json();

TownieuseCreateProject.tsx1 match

@bipin0005•Updated 1 hour ago
1import { useState, useEffect } from "react";
2
3const ENDPOINT = "/api/create-project";
4
5export function useCreateProject() {

shippingAPI1 file match

@dynamic_silver•Updated 15 hours ago

Galacta3 file matches

@defunkt•Updated 1 day ago
Marvel Rivals GPT via tracker.gg API
apiry
snartapi