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/?q=api&page=207&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 18627 results for "api"(2280ms)

LinaREADME.md8 matches

@Linaโ€ขUpdated 1 week ago
19โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Database query functions
20โ”‚ โ”œโ”€โ”€ routes/
21โ”‚ โ”‚ โ”œโ”€โ”€ jobs.ts # Job posting API routes
22โ”‚ โ”‚ โ””โ”€โ”€ chat.ts # Chat API routes
23โ”‚ โ””โ”€โ”€ index.ts # Main Hono server
24โ”œโ”€โ”€ frontend/
34```
35
36## API Endpoints
37
38### Jobs
39- `GET /api/jobs` - Get all job postings
40- `POST /api/jobs` - Create a new job posting
41- `DELETE /api/jobs/:id` - Delete a job posting
42
43### Chat
44- `GET /api/chat/messages` - Get chat messages
45- `POST /api/chat/messages` - Send a chat message
46
47## Getting Started

Anonymousindex.ts3 matches

@eddie_walkโ€ขUpdated 1 week ago
15await runMigrations();
16
17// API routes
18app.route("/api/questions", questions);
19app.route("/api/responses", responses);
20
21// Serve static files

AnonymousMyQuestions.tsx1 match

@eddie_walkโ€ขUpdated 1 week ago
25 const fetchMyQuestions = async (id: string) => {
26 try {
27 const response = await fetch(`/api/questions/by-anonymous-id/${id}`);
28 if (!response.ok) {
29 throw new Error('Failed to fetch your questions');

AnonymousResponseForm.tsx1 match

@eddie_walkโ€ขUpdated 1 week ago
31
32 try {
33 const res = await fetch('/api/responses', {
34 method: 'POST',
35 headers: {

Job-Listingchat.ts9 matches

@thesleekcoderโ€ขUpdated 1 week ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { getRecentMessages, createMessage } from "../database/queries.ts";
3import type { ChatMessage, ApiResponse } from "../../shared/types.ts";
4
5const chat = new Hono();
9 try {
10 const messages = await getRecentMessages(50);
11 const response: ApiResponse<ChatMessage[]> = {
12 success: true,
13 data: messages
15 return c.json(response);
16 } catch (error) {
17 const response: ApiResponse<ChatMessage[]> = {
18 success: false,
19 error: "Failed to fetch messages"
30 // Basic validation
31 if (!messageData.username || !messageData.message) {
32 const response: ApiResponse<ChatMessage> = {
33 success: false,
34 error: "Username and message are required"
42
43 if (messageData.message.length === 0) {
44 const response: ApiResponse<ChatMessage> = {
45 success: false,
46 error: "Message cannot be empty"
50
51 if (messageData.message.length > 500) {
52 const response: ApiResponse<ChatMessage> = {
53 success: false,
54 error: "Message too long (max 500 characters)"
58
59 if (messageData.username.length > 50) {
60 const response: ApiResponse<ChatMessage> = {
61 success: false,
62 error: "Username too long (max 50 characters)"
66
67 const newMessage = await createMessage(messageData);
68 const response: ApiResponse<ChatMessage> = {
69 success: true,
70 data: newMessage
72 return c.json(response, 201);
73 } catch (error) {
74 const response: ApiResponse<ChatMessage> = {
75 success: false,
76 error: "Failed to send message"

AnonymousQuestionFeed.tsx1 match

@eddie_walkโ€ขUpdated 1 week ago
16 const fetchQuestions = async () => {
17 try {
18 const response = await fetch('/api/questions');
19 if (!response.ok) {
20 throw new Error('Failed to fetch questions');

Job-Listingjobs.ts11 matches

@thesleekcoderโ€ขUpdated 1 week ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { getAllJobs, createJob, deleteJob } from "../database/queries.ts";
3import type { Job, ApiResponse } from "../../shared/types.ts";
4
5const jobs = new Hono();
9 try {
10 const jobList = await getAllJobs();
11 const response: ApiResponse<Job[]> = {
12 success: true,
13 data: jobList
15 return c.json(response);
16 } catch (error) {
17 const response: ApiResponse<Job[]> = {
18 success: false,
19 error: "Failed to fetch jobs"
31 if (!jobData.title || !jobData.company || !jobData.description ||
32 !jobData.location || !jobData.contact_email) {
33 const response: ApiResponse<Job> = {
34 success: false,
35 error: "Missing required fields"
41 const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
42 if (!emailRegex.test(jobData.contact_email)) {
43 const response: ApiResponse<Job> = {
44 success: false,
45 error: "Invalid email format"
49
50 const newJob = await createJob(jobData);
51 const response: ApiResponse<Job> = {
52 success: true,
53 data: newJob
55 return c.json(response, 201);
56 } catch (error) {
57 const response: ApiResponse<Job> = {
58 success: false,
59 error: "Failed to create job"
68 const id = parseInt(c.req.param("id"));
69 if (isNaN(id)) {
70 const response: ApiResponse<boolean> = {
71 success: false,
72 error: "Invalid job ID"
77 const deleted = await deleteJob(id);
78 if (!deleted) {
79 const response: ApiResponse<boolean> = {
80 success: false,
81 error: "Job not found"
84 }
85
86 const response: ApiResponse<boolean> = {
87 success: true,
88 data: true
90 return c.json(response);
91 } catch (error) {
92 const response: ApiResponse<boolean> = {
93 success: false,
94 error: "Failed to delete job"

untitled-288App.tsx5 matches

@Ruepearlโ€ขUpdated 1 week ago
26 setError(null);
27
28 const response = await fetch("/api/quotes/daily");
29 const data = await response.json();
30
44 const loadCategories = async () => {
45 try {
46 const response = await fetch("/api/quotes/categories");
47 const data = await response.json();
48 setAvailableCategories(data.categories || []);
54 const loadHistory = async () => {
55 try {
56 const response = await fetch("/api/quotes/history");
57 const data: QuoteHistory = await response.json();
58 setHistory(data.quotes || []);
71 if (customTheme.trim()) requestBody.theme = customTheme.trim();
72
73 const response = await fetch("/api/quotes/generate", {
74 method: "POST",
75 headers: { "Content-Type": "application/json" },
210 <p className="text-gray-900 font-medium mb-2 line-clamp-2">"{quote.text}"</p>
211 <div className="flex items-center justify-between text-sm text-gray-500">
212 <span className="capitalize">{quote.category.replace('-', ' ')} โ€ข {quote.theme}</span>
213 <span>{new Date(quote.date).toLocaleDateString()}</span>
214 </div>

AnonymousQuestionForm.tsx1 match

@eddie_walkโ€ขUpdated 1 week ago
28
29 try {
30 const response = await fetch('/api/questions', {
31 method: 'POST',
32 headers: {

Job-Listingtypes.ts1 match

@thesleekcoderโ€ขUpdated 1 week ago
19}
20
21export interface ApiResponse<T> {
22 success: boolean;
23 data?: T;

shippingAPI1 file match

@dynamic_silverโ€ขUpdated 8 hours ago

Galacta3 file matches

@defunktโ€ขUpdated 1 day ago
Marvel Rivals GPT via tracker.gg API
Kapil01
apiv1