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=116&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 13428 results for "api"(1171ms)

testval5README.md1 match

@dcm31โ€ขUpdated 5 days ago
24- Stores the first 1000 digits of Pi
25- Runs as an HTTP-triggered Val on Val Town
26- No external dependencies or API calls required
27
28## Future Improvements

yyyindex.ts3 matches

@seoxoโ€ขUpdated 5 days ago
15app.use("*", cors());
16
17// API routes
18app.get("/api/products", async (c) => {
19 try {
20 const products = await getProducts();
26});
27
28app.get("/api/products/:id", async (c) => {
29 try {
30 const id = c.req.param("id");

yyyCartSidebar.tsx1 match

@seoxoโ€ขUpdated 5 days ago
21 const handleCheckout = () => {
22 // In a real implementation, this would redirect to Shopify checkout
23 // or integrate with their Checkout API
24 alert("In a real implementation, this would redirect to Shopify checkout.");
25 };

yyyApp.tsx2 matches

@seoxoโ€ขUpdated 5 days ago
52 setSelectedProduct(existingProduct);
53 } else {
54 // Fetch product details from API
55 const response = await fetch(`/api/products/${productId}`);
56 if (!response.ok) {
57 throw new Error("Failed to fetch product details");

yyyshopify.ts13 matches

@seoxoโ€ขUpdated 5 days ago
1import { Product, ProductVariant } from "../shared/types";
2
3// Shopify API credentials from environment variables
4const SHOPIFY_API_KEY = Deno.env.get("SHOPIFY_API_KEY");
5const SHOPIFY_API_SECRET = Deno.env.get("SHOPIFY_API_SECRET");
6const SHOPIFY_STORE_URL = Deno.env.get("SHOPIFY_STORE_URL");
7
8// Check if credentials are available
9const hasCredentials = SHOPIFY_API_KEY && SHOPIFY_API_SECRET && SHOPIFY_STORE_URL;
10
11// Sample poster products data for development/demo
112
113/**
114 * Fetches products from Shopify API or returns sample data if credentials are not available
115 */
116export async function getProducts(): Promise<Product[]> {
121
122 try {
123 // Shopify GraphQL API query to fetch products
124 const query = `
125 {
165 `;
166
167 const response = await fetch(`${SHOPIFY_STORE_URL}/api/2023-10/graphql.json`, {
168 method: "POST",
169 headers: {
170 "Content-Type": "application/json",
171 "X-Shopify-Access-Token": SHOPIFY_API_SECRET!
172 },
173 body: JSON.stringify({ query })
175
176 if (!response.ok) {
177 throw new Error(`Shopify API error: ${response.status} ${response.statusText}`);
178 }
179
218
219 try {
220 // Shopify GraphQL API query to fetch a single product
221 const query = `
222 {
258 `;
259
260 const response = await fetch(`${SHOPIFY_STORE_URL}/api/2023-10/graphql.json`, {
261 method: "POST",
262 headers: {
263 "Content-Type": "application/json",
264 "X-Shopify-Access-Token": SHOPIFY_API_SECRET!
265 },
266 body: JSON.stringify({ query })
268
269 if (!response.ok) {
270 throw new Error(`Shopify API error: ${response.status} ${response.statusText}`);
271 }
272

yyyREADME.md6 matches

@seoxoโ€ขUpdated 5 days ago
7```
8โ”œโ”€โ”€ backend/
9โ”‚ โ”œโ”€โ”€ index.ts # Main API entry point with Hono
10โ”‚ โ”œโ”€โ”€ shopify.ts # Shopify API integration
11โ”‚ โ””โ”€โ”€ routes/ # API route handlers
12โ”œโ”€โ”€ frontend/
13โ”‚ โ”œโ”€โ”€ components/ # React components
31- Backend: Hono framework on Val Town
32- Frontend: React with Tailwind CSS
33- Data: Shopify API integration
34- Deployment: Val Town HTTP trigger
35
36## Setup
37
381. Set up your Shopify store and obtain API credentials
392. Add your Shopify API key and secret as environment variables in Val Town
403. Deploy the Val and access your store!

spreadchatapp.js6 matches

@twitchardโ€ขUpdated 5 days ago
22 setupEventListeners(spreadsheet);
23
24 // Expose spreadsheet API to parent window
25 exposeSpreadsheetAPI(spreadsheet);
26});
27
140 confirmImportBtn.disabled = true;
141
142 const response = await fetch('/api/import-sheets', {
143 method: 'POST',
144 headers: {
228
229/**
230 * Expose spreadsheet API to parent window
231 * This allows external code to interact with the spreadsheet
232 */
233function exposeSpreadsheetAPI(spreadsheet) {
234 // Create API object
235 window.valSpreadsheet = {
236 // Get current spreadsheet data

spreadchatsheets-import.ts3 matches

@twitchardโ€ขUpdated 5 days ago
1// This file would contain the actual Google Sheets import functionality
2// For a complete implementation, we would need to:
3// 1. Use the Google Sheets API to fetch sheet data
4// 2. Convert the data to a format compatible with x-spreadsheet
5// 3. Return the formatted data
6
7// For now, this is a placeholder that would be expanded with actual implementation
8// using the Google Sheets API and SheetJS for data conversion
9
10export async function importFromGoogleSheets(sheetUrl: string) {
18
19 // In a real implementation, we would:
20 // 1. Call the Google Sheets API using the sheet ID
21 // 2. Process the response with SheetJS
22 // 3. Convert to x-spreadsheet format

spreadchatindex.ts2 matches

@twitchardโ€ขUpdated 5 days ago
34app.get("/frontend/*", c => serveFile(c.req.path, import.meta.url));
35
36// API endpoint to import from Google Sheets
37app.post("/api/import-sheets", async (c) => {
38 try {
39 const body = await c.req.json();

spreadchatREADME.md1 match

@twitchardโ€ขUpdated 5 days ago
252. Use the spreadsheet interface to create, edit, and manage data
263. Import data from Google Sheets using the import button
274. Access selected cell data via the exposed JavaScript API
28
29## Technical Details

vapi-minutes-db1 file match

@henrywilliamsโ€ขUpdated 3 days ago

vapi-minutes-db2 file matches

@henrywilliamsโ€ขUpdated 4 days ago
Kapil01
mux
Your friendly, neighborhood video API.