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/$1?q=api&page=2&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 14940 results for "api"(645ms)

tourguideindex.ts1 match

@neverstew•Updated 4 hours ago
15
16// Mount routes
17app.route("/api/itinerary", itineraryRoutes);
18app.route("/", staticRoutes);
19

tourguideTourGuide.tsx2 matches

@neverstew•Updated 4 hours ago
205 <div className="flex gap-2 mt-2">
206 <button
207 onClick={() => window.open(`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(currentStop.location.address)}`, '_blank')}
208 className="bg-blue-600 text-white px-3 py-1 rounded text-sm font-medium hover:bg-blue-700 transition-colors"
209 >
310 </div>
311 <button
312 onClick={() => window.open(`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(currentStop.location.address)}`, '_blank')}
313 className="mt-3 bg-white bg-opacity-20 text-white px-4 py-2 rounded-lg hover:bg-opacity-30 transition-colors"
314 >

tourguideItineraryView.tsx1 match

@neverstew•Updated 4 hours ago
226
227 <button
228 onClick={() => window.open(`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(stop.location.address)}`, '_blank')}
229 className="text-green-600 hover:text-green-800 text-sm font-medium"
230 >

tourguideSearchForm.tsx1 match

@neverstew•Updated 4 hours ago
53
54 try {
55 const response = await fetch('/api/itinerary/generate', {
56 method: 'POST',
57 headers: { 'Content-Type': 'application/json' },

tourguideApp.tsx4 matches

@neverstew•Updated 4 hours ago
51 try {
52 setState(prev => ({ ...prev, isLoading: true }));
53 const response = await fetch('/api/itinerary');
54 const result = await response.json();
55
87 try {
88 // Check for existing progress
89 const response = await fetch(`/api/itinerary/${itinerary.id}/progress`);
90 const result = await response.json();
91
119
120 try {
121 await fetch(`/api/itinerary/${progress.itineraryId}/progress`, {
122 method: 'POST',
123 headers: { 'Content-Type': 'application/json' },
131 const handleDeleteItinerary = async (id: string) => {
132 try {
133 const response = await fetch(`/api/itinerary/${id}`, {
134 method: 'DELETE'
135 });

tourguidesw.js4 matches

@neverstew•Updated 4 hours ago
47 const url = new URL(request.url);
48
49 // Handle API requests
50 if (url.pathname.startsWith('/api/')) {
51 event.respondWith(
52 fetch(request)
53 .then(response => {
54 // Cache successful API responses
55 if (response.ok && request.method === 'GET') {
56 const responseClone = response.clone();
67 return cachedResponse;
68 }
69 // Return offline message for failed API calls
70 return new Response(
71 JSON.stringify({

tourguideitinerary.ts16 matches

@neverstew•Updated 4 hours ago
9 getTourProgress
10} from "../database/queries.ts";
11import type { Itinerary, ItineraryRequest, TourProgress, ApiResponse } from "../../shared/types.ts";
12
13const app = new Hono();
23
24 if (!request.destination) {
25 return c.json<ApiResponse<null>>({
26 success: false,
27 error: 'Destination is required'
105 await saveItinerary(itinerary);
106
107 return c.json<ApiResponse<Itinerary>>({
108 success: true,
109 data: itinerary
112 } catch (error) {
113 console.error('Error generating itinerary:', error);
114 return c.json<ApiResponse<null>>({
115 success: false,
116 error: 'Failed to generate itinerary'
125
126 if (!itinerary) {
127 return c.json<ApiResponse<null>>({
128 success: false,
129 error: 'Itinerary not found'
131 }
132
133 return c.json<ApiResponse<Itinerary>>({
134 success: true,
135 data: itinerary
137 } catch (error) {
138 console.error('Error fetching itinerary:', error);
139 return c.json<ApiResponse<null>>({
140 success: false,
141 error: 'Failed to fetch itinerary'
147 try {
148 const itineraries = await getAllItineraries();
149 return c.json<ApiResponse<Itinerary[]>>({
150 success: true,
151 data: itineraries
153 } catch (error) {
154 console.error('Error fetching itineraries:', error);
155 return c.json<ApiResponse<null>>({
156 success: false,
157 error: 'Failed to fetch itineraries'
166
167 if (!deleted) {
168 return c.json<ApiResponse<null>>({
169 success: false,
170 error: 'Itinerary not found'
172 }
173
174 return c.json<ApiResponse<null>>({
175 success: true
176 });
177 } catch (error) {
178 console.error('Error deleting itinerary:', error);
179 return c.json<ApiResponse<null>>({
180 success: false,
181 error: 'Failed to delete itinerary'
191 await saveTourProgress({ ...progress, itineraryId });
192
193 return c.json<ApiResponse<null>>({
194 success: true
195 });
196 } catch (error) {
197 console.error('Error saving progress:', error);
198 return c.json<ApiResponse<null>>({
199 success: false,
200 error: 'Failed to save progress'
208 const progress = await getTourProgress(itineraryId);
209
210 return c.json<ApiResponse<TourProgress | null>>({
211 success: true,
212 data: progress
214 } catch (error) {
215 console.error('Error fetching progress:', error);
216 return c.json<ApiResponse<null>>({
217 success: false,
218 error: 'Failed to fetch progress'

tourguidetypes.ts1 match

@neverstew•Updated 4 hours ago
53}
54
55export interface ApiResponse<T> {
56 success: boolean;
57 data?: T;

tourguideREADME.md6 matches

@neverstew•Updated 4 hours ago
37```
38
39## API Endpoints
40
41- `GET /` - Main application
42- `POST /api/itinerary/generate` - Generate new itinerary
43- `GET /api/itinerary/:id` - Get specific itinerary
44- `GET /api/itinerary` - List all itineraries
45- `DELETE /api/itinerary/:id` - Delete itinerary
46
47## Technology Stack
49- **Backend**: Hono + SQLite + OpenAI
50- **Frontend**: React + TypeScript + TailwindCSS
51- **Offline**: Service Workers + Cache API
52- **Storage**: SQLite for persistence, localStorage for offline data

charmaineValSearchstyles.tsx4 matches

@charmaine•Updated 4 hours ago
782}
783
784.api-info {
785 margin-top: 10px;
786}
787
788.api-info summary {
789 cursor: pointer;
790 color: var(--primary-color);
792}
793
794.api-docs {
795 background-color: var(--code-bg);
796 padding: 10px 15px;
801}
802
803.api-docs code {
804 display: inline-block;
805 background-color: white;

HN-fetch-call2 file matches

@ImGqb•Updated 7 hours ago
fetch HackerNews by API

token-server1 file match

@kwhinnery_openai•Updated 1 day ago
Mint tokens to use with the OpenAI Realtime API for WebRTC
rapilot330
Kapil01