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%22Image%20title%22?q=api&page=63&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 13864 results for "api"(1231ms)

22 try {
23 const token = localStorage.getItem('teacherToken') || '';
24 const response = await fetch(`/api/quiz/${quiz.quiz_id}/submissions`, {
25 headers: {
26 'Authorization': `Bearer ${token}`

RoshanMustaqbilLoginForm.tsx1 match

@debuggerist•Updated 2 days ago
17
18 // For demo purposes, we're using a mock token
19 // In a real app, you would authenticate with your API
20 setTimeout(() => {
21 // Mock successful login for teacher@example.com/password

RoshanMustaqbilindex.tsx1 match

@debuggerist•Updated 2 days ago
28
29 try {
30 const response = await fetch('/api/dashboard', {
31 headers: {
32 'Authorization': `Bearer ${token}`

RoshanMustaqbilapi.ts6 matches

@debuggerist•Updated 2 days ago
1// Mock API functions for teacher dashboard
2// In real implementation, these would connect to your actual backend API
3
4import { User, Quiz, QuizSubmission, QuizWithStats, SubmissionStats, DashboardData } from './types';
5
6// Mock data - replace with actual API calls
7const MOCK_TEACHER: User = {
8 user_id: "t123",
162// Get teacher data with authentication token
163export async function getTeacherData(token: string): Promise<User | null> {
164 // In real implementation, validate token with your API
165 // For mock, just return the teacher
166 return MOCK_TEACHER;
169// Get all quizzes for a teacher with stats
170export async function getTeacherQuizzes(teacherId: string): Promise<QuizWithStats[]> {
171 // In real implementation, fetch from your API
172 const teacherQuizzes = MOCK_QUIZZES.filter(q => q.teacher_id === teacherId);
173
180// Get submissions for a specific quiz
181export async function getQuizSubmissions(quizId: string): Promise<QuizSubmission[]> {
182 // In real implementation, fetch from your API
183 return MOCK_SUBMISSIONS.filter(s => s.quiz_id === quizId);
184}

RoshanMustaqbiltypes.ts2 matches

@debuggerist•Updated 2 days ago
48}
49
50// API Response types
51export interface ApiResponse<T> {
52 success: boolean;
53 data?: T;

RoshanMustaqbilREADME.md2 matches

@debuggerist•Updated 2 days ago
9## Project Structure
10
11- `backend/` - Server-side code aur API endpoints
12 - `index.ts` - Main HTTP handler
13 - `types.ts` - TypeScript types
14 - `api.ts` - API functions
15- `frontend/` - Client-side code
16 - `index.html` - Main HTML template

May19README.md1 match

@MattPayneOrg•Updated 2 days ago
35 - React for UI components and state management
36 - TailwindCSS for styling
37 - LocalStorage API for data persistence
38
39## Usage

GutenbergREADME.md6 matches

@aleaf•Updated 2 days ago
1# Project Gutenberg Metadata API
2
3This API provides a simple way to retrieve metadata about books from Project Gutenberg in JSON format.
4
5## API Endpoint
6
7The API has a single endpoint that accepts a book ID and returns metadata about that book.
8
9### Request
25### Response
26
27The API returns a JSON object with the following fields (when available):
28
29- `id`: The Project Gutenberg book ID
80## Notes
81
82- This API scrapes data from Project Gutenberg's website and may break if their site structure changes
83- Results are cached for 24 hours to reduce load on Project Gutenberg's servers
84- Please be respectful of Project Gutenberg's resources and don't make excessive requests

Gutenberggutenberg-metadata.ts2 matches

@aleaf•Updated 2 days ago
1/**
2 * Project Gutenberg Metadata API
3 *
4 * This API endpoint retrieves metadata about books from Project Gutenberg
5 * and returns it in a structured JSON format.
6 *

fREADME.md1 match

@damonlin•Updated 2 days ago
13This is a simplified version of a Twitter clone that uses:
14
15- Backend: Hono.js for API routing
16- Database: Val Town SQLite for storing tweets
17- Frontend: Simple HTML/CSS/JS with Tailwind CSS for styling

new-val-api-demo

@shouser•Updated 9 hours ago
This is an example of using the API to create a val.

groq-api2 file matches

@cameronpak•Updated 13 hours ago
mux
Your friendly, neighborhood video API.
api