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=95&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 13031 results for "api"(826ms)

automate-workflowsREADME.md4 matches

@charmaineUpdated 4 days ago
5## Files
6
7- `index.ts` - Main entry point for the HTTP API (Hono app)
8- `github.ts` - GitHub API client for fetching repository data
9
10## API Endpoints
11
12### POST /api/release-notes
13
14Generates release notes based on GitHub commits.

automate-workflowsindex.ts2 matches

@charmaineUpdated 4 days ago
26});
27
28// API endpoint to generate release notes
29app.post('/api/release-notes', async c => {
30 try {
31 const data = await c.req.json<ReleaseNotesRequest>();

automate-workflowsindex.js2 matches

@charmaineUpdated 4 days ago
49
50 try {
51 // Call API
52 const response = await fetch('/api/release-notes', {
53 method: 'POST',
54 headers: {

automate-workflowsgithub.ts3 matches

@charmaineUpdated 4 days ago
1import { GitHubCommit } from '../shared/types';
2
3// GitHub API client
4export class GitHubClient {
5 private baseUrl = 'https://api.github.com';
6 private token: string;
7
29 if (!response.ok) {
30 const error = await response.text();
31 throw new Error(`GitHub API error (${response.status}): ${error}`);
32 }
33

automate-workflowsREADME.md2 matches

@charmaineUpdated 4 days ago
29## Project Structure
30
31- `backend/` - API endpoints and GitHub integration
32- `frontend/` - User interface for the app
33- `shared/` - Shared types and utilities
36
37- TypeScript
38- GitHub REST API
39- Hono (backend framework)
40- React (frontend)

AppTramindex.ts5 matches

@SineyUpdated 4 days ago
24app.use("/*", cors());
25
26// API routes
27app.route("/api/auth", auth);
28app.route("/api/tickets", tickets);
29app.route("/api/verification", verification);
30
31// Serve static files
40 // Add initial data to avoid extra round-trips
41 const initialData = {
42 apiUrl: "/api"
43 };
44

Testmayindex.ts5 matches

@charmaineUpdated 4 days ago
21});
22
23// API Routes
24app.get("/api/todos", async (c) => {
25 const todos = await getTodos();
26 return c.json(todos);
27});
28
29app.post("/api/todos", async (c) => {
30 const data = await c.req.json();
31 const todo = await addTodo(data.text);
33});
34
35app.put("/api/todos/:id", async (c) => {
36 const id = parseInt(c.req.param("id"));
37 const data = await c.req.json();
40});
41
42app.delete("/api/todos/:id", async (c) => {
43 const id = parseInt(c.req.param("id"));
44 await deleteTodo(id);

AppTramAuth.tsx3 matches

@SineyUpdated 4 days ago
3import { UserProfile } from "../../shared/types.ts";
4
5// Get API URL from initial data
6const apiUrl = (window as any).__INITIAL_DATA__?.apiUrl || "/api";
7
8interface AuthProps {
48
49 // Send request
50 const response = await fetch(`${apiUrl}/auth/${endpoint}`, {
51 method: "POST",
52 headers: {

AppTramindex.tsx4 matches

@SineyUpdated 4 days ago
19
20// Get initial data from the server
21const initialData = (window as any).__INITIAL_DATA__ || { apiUrl: "/api" };
22
23// App state types
102 const fetchTickets = async (token: string) => {
103 try {
104 const response = await fetch(`${initialData.apiUrl}/tickets`, {
105 headers: {
106 "Authorization": `Bearer ${token}`
141 const handleTicketPurchase = async (ticketType: string) => {
142 try {
143 const response = await fetch(`${initialData.apiUrl}/tickets/purchase`, {
144 method: "POST",
145 headers: {
180 const handleVerifyTicket = async (code: string) => {
181 try {
182 const response = await fetch(`${initialData.apiUrl}/verification/verify`, {
183 method: "POST",
184 headers: {

AppTramverification.ts13 matches

@SineyUpdated 4 days ago
2import { jwtMiddleware } from "./auth.ts";
3import { getTicketByVerificationCode, verifyTicket } from "../database/queries.ts";
4import { ApiResponse, VerificationRequest, VerificationResponse } from "../../shared/types.ts";
5
6const verification = new Hono();
12
13 if (!code) {
14 return c.json<ApiResponse<null>>({
15 success: false,
16 error: "Verification code is required"
21
22 if (!ticket) {
23 return c.json<ApiResponse<VerificationResponse>>({
24 success: true,
25 data: {
34 // Check if ticket is expired
35 if (ticket.expirationTime < now) {
36 return c.json<ApiResponse<VerificationResponse>>({
37 success: true,
38 data: {
46 // Check if ticket is already used
47 if (ticket.status !== "active") {
48 return c.json<ApiResponse<VerificationResponse>>({
49 success: true,
50 data: {
59 await verifyTicket(ticket.id);
60
61 return c.json<ApiResponse<VerificationResponse>>({
62 success: true,
63 data: {
72 } catch (error) {
73 console.error("Error verifying ticket:", error);
74 return c.json<ApiResponse<null>>({
75 success: false,
76 error: "Failed to verify ticket"
86 // Check if user is admin
87 if (!isAdmin) {
88 return c.json<ApiResponse<null>>({
89 success: false,
90 error: "Unauthorized"
95
96 if (!code) {
97 return c.json<ApiResponse<null>>({
98 success: false,
99 error: "Verification code is required"
104
105 if (!ticket) {
106 return c.json<ApiResponse<null>>({
107 success: false,
108 error: "Invalid ticket code"
116
117 if (!verified) {
118 return c.json<ApiResponse<null>>({
119 success: false,
120 error: "Failed to mark ticket as used"
122 }
123
124 return c.json<ApiResponse<{ message: string }>>({
125 success: true,
126 data: {
130 } catch (error) {
131 console.error("Error marking ticket as used:", error);
132 return c.json<ApiResponse<null>>({
133 success: false,
134 error: "Failed to mark ticket as used"

vapi-minutes-db1 file match

@henrywilliamsUpdated 2 days ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 2 days ago
papimark21
socialdata
Affordable & reliable alternative to Twitter API: ➡️ Access user profiles, tweets, followers & timeline data in real-time ➡️ Monitor profiles with nearly instant alerts for new tweets, follows & profile updates ➡️ Simple integration