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=156&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 14198 results for "api"(904ms)

doorREADME.md5 matches

@stevekrouse•Updated 6 days ago
9[**Video demo**](https://www.tiktok.com/@stevekrouse/video/7398180191396318497?is_from_webapp=1&sender_device=pc)
10
11### Switchbot API Integration
12
13This Val authenticates to the Switchbot API with `SWITCHBOT_TOKEN` and `SWITCHBOT_KEY` environment variables.
14
15The application uses the Switchbot API to send a "press" command to the device with ID `D2353438164D` (Val Town Ground Floor device).
16
17Learn how to get your own Switchbot API keys here: [Switchbot Docs](https://github.com/OpenWonderLabs/SwitchBotAPI).
18
19### Project Structure
20
21- `main.tsx`: The main application file with Hono routes and UI components
22- `utils.tsx`: Utility functions for Switchbot API authentication and requests
23- `styles.tsx`: CSS styles for the web interface

YouthCareerToolkitREADME.md2 matches

@bolajeee•Updated 6 days ago
12- `PortfolioFormData` - Interface for the form data
13- `ContentType` - Type for the content type options
14- `GenerateRequest` - Interface for the API request
15- `GenerateResponse` - Interface for the API response
16
17## Utilities

YouthCareerToolkitREADME.md1 match

@bolajeee•Updated 6 days 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 6 days 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 6 days 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 6 days 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() {

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 2 days ago
This is an example of using the API to create a val.
snartapi
mux
Your friendly, neighborhood video API.