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/$%7Burl%7D?q=api&page=152&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 13278 results for "api"(1235ms)

CoffeTimeapi.tsx0 matches

@robertcardilloUpdated 1 week ago
1import { blob } from "https://esm.town/v/std/blob";
2
3export default async function(req: Request): Promise<Response> {
4 const token = req.headers.get("authorization")?.split(" ")?.at(1);
5

EEPPortalweeklyReport.tsx2 matches

@solomonferedeUpdated 1 week ago
371 headers.map(field => {
372 const value = row[field] == null ? "" : String(row[field]);
373 // Basic CSV escaping: replace " with "" and wrap field in quotes if it contains , " or newline
374 const needsQuotes = /[,"\n]/.test(value);
375 const escapedValue = value.replace(/"/g, "\"\"");
865 headers.map(field => {
866 const value = row[field] == null ? "" : String(row[field]);
867 // Basic CSV escaping: replace " with "" and wrap field in quotes if it contains , " or newline
868 const needsQuotes = /[,"\n]/.test(value);
869 const escapedValue = value.replace(/"/g, "\"\"");

Townieuser-summary.ts1 match

@pomdtrUpdated 1 week ago
20 SUM(num_images) as total_images
21 FROM ${USAGE_TABLE}
22 WHERE our_api_token = 1
23 GROUP BY user_id, username
24 ORDER BY total_price DESC

TownieuseProject.tsx2 matches

@pomdtrUpdated 1 week ago
2import { useAuth } from "./useAuth.tsx";
3
4const PROJECT_ENDPOINT = "/api/project";
5const FILES_ENDPOINT = "/api/project-files";
6
7export function useProject (projectId: string, branchId?: string) {

TownieuseProjects.tsx1 match

@pomdtrUpdated 1 week ago
2import { useAuth } from "./useAuth.tsx";
3
4const ENDPOINT = "/api/projects-loader";
5
6export function useProjects () {

TownieuseCreateProject.tsx1 match

@pomdtrUpdated 1 week ago
3import { useAuth } from "./useAuth.tsx";
4
5const ENDPOINT = "/api/create-project";
6
7export function useCreateProject () {

TownieuseCreateBranch.tsx1 match

@pomdtrUpdated 1 week ago
2import { useAuth } from "./useAuth.tsx";
3
4const ENDPOINT = "/api/create-branch";
5
6export function useCreateBranch (projectId: string) {

TownieuseChatLogic.ts4 matches

@pomdtrUpdated 1 week ago
6 project: any;
7 branchId: string | undefined;
8 anthropicApiKey: string;
9 bearerToken: string;
10 selectedFiles: string[];
16 project,
17 branchId,
18 anthropicApiKey,
19 bearerToken,
20 selectedFiles,
37 status,
38 } = useChat({
39 api: "/api/send-message",
40 body: {
41 project,
42 branchId,
43 anthropicApiKey,
44 selectedFiles,
45 images: images

TownieuseBranches.tsx1 match

@pomdtrUpdated 1 week ago
2import { useAuth } from "./useAuth.tsx";
3
4const ENDPOINT = "/api/project-branches";
5
6export function useBranches (projectId: string) {

TownieuseAuth.tsx11 matches

@pomdtrUpdated 1 week ago
3
4const TOKEN_KEY = "bearer";
5const ANTHROPIC_KEY = "anthropic_api_key";
6
7export function useAuth() {
8 const [token, setToken, removeToken] = useLocalStorage(TOKEN_KEY, "");
9 const [anthropicApiKey, setAnthropicApiKey, removeAnthropicApiKey] = useLocalStorage(ANTHROPIC_KEY, "");
10 const [error, setError] = useState(null);
11
12 const isAuthenticated = !!token;
13
14 const authenticate = async (valTownAPIKey: string, anthropicKey: string) => {
15 // replace all this with oauth when it's ready
16 try {
17 const res = await fetch("/api/user", {
18 headers: {
19 "Authorization": "Bearer " + valTownAPIKey,
20 },
21 });
25 setError(data.error);
26 removeToken();
27 removeAnthropicApiKey();
28 return;
29 }
30 setError(null);
31 setToken(valTownAPIKey);
32 setAnthropicApiKey(anthropicKey);
33 } catch (e) {
34 console.error(e);
35 setError(e.error);
36 removeToken();
37 removeAnthropicApiKey();
38 }
39 };
41 const logOut = () => {
42 removeToken();
43 removeAnthropicApiKey();
44 };
45
50 logOut,
51 token,
52 anthropicApiKey,
53 };
54}

vapi-minutes-db1 file match

@henrywilliamsUpdated 3 days ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 3 days ago
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