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%22Optional%20title%22?q=api&page=162&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 14255 results for "api"(975ms)

YouthCareerToolkitREADME.md1 match

@bolajeee•Updated 1 week ago
191. The user fills out the form with their professional information
202. They select what type of content they want to generate
213. The form data is sent to the backend API
224. The generated content is displayed in the result container
235. The user can copy the content or regenerate it if needed

YouthCareerToolkitindex.html2 matches

@bolajeee•Updated 1 week ago
202
203 try {
204 // Send request to API
205 const response = await fetch('/api/generate', {
206 method: 'POST',
207 headers: {

stockAppViewInventoryView.tsx5 matches

@prashamtrivedi•Updated 1 week ago
3import { useState, useEffect } from "https://esm.sh/preact@10.19.6/hooks";
4import { User, Product, InventoryBatch } from "../../shared/types.ts";
5// import * as apiClient from "../apiClient.ts"; // Will be removed
6
7const API_BASE_URL = "/api";
8
9interface ViewInventoryViewProps {
28 if (searchTerm) queryParams.append("search", searchTerm);
29 const queryString = queryParams.toString();
30 let response = await fetch(`${API_BASE_URL}/products${queryString ? `?${queryString}` : ""}`, {
31 headers: { "Accept": "application/json", "X-User-Id": currentUser.id } // X-User-Id might not be strictly needed by backend for GET products
32 });
42 try {
43 // Direct fetch for total product quantity
44 const qtyResponse = await fetch(`${API_BASE_URL}/inventory/products/${p.id}/total`, {
45 headers: { "Accept": "application/json", "X-User-Id": currentUser.id } // X-User-Id might not be strictly needed
46 });
82 try {
83 // Direct fetch for inventory batches by product
84 const response = await fetch(`${API_BASE_URL}/inventory/batches?productId=${product.id}`, {
85 headers: { "Accept": "application/json", "X-User-Id": currentUser.id } // X-User-Id might not be strictly needed
86 });

stockAppExpiringItemsView.tsx3 matches

@prashamtrivedi•Updated 1 week ago
3import { useState, useEffect } from "https://esm.sh/preact@10.19.6/hooks";
4import { User, InventoryBatch } from "../../shared/types.ts";
5// import * as apiClient from "../apiClient.ts"; // Will be removed
6
7const API_BASE_URL = "/api";
8
9interface ExpiringItemsViewProps {
30 if (filterDays !== undefined) queryParams.append("days", String(filterDays));
31 const queryString = queryParams.toString();
32 const response = await fetch(`${API_BASE_URL}/inventory/expiring${queryString ? `?${queryString}` : ""}`, {
33 headers: { "Accept": "application/json", "X-User-Id": currentUser.id } // X-User-Id might not be strictly needed
34 });

TownieuseUser.tsx1 match

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

Townieuser-summary.ts1 match

@Ana•Updated 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

@Ana•Updated 1 week 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

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

TownieuseCreateProject.tsx1 match

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

TownieuseCreateBranch.tsx1 match

@Ana•Updated 1 week ago
1import { useState, useEffect } from "react";
2
3const ENDPOINT = "/api/create-branch";
4
5export function useCreateBranch(projectId: string) {

book-lookup5 file matches

@nucky•Updated 1 day ago
use google book api to look up bibliographic metadata elements

new-val-api-demo

@shouser•Updated 3 days ago
This is an example of using the API to create a val.
snartapi
mux
Your friendly, neighborhood video API.