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=49&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 18288 results for "api"(2401ms)

my-first-valindex.tsx1 match

@Onujulesโ€ขUpdated 3 days ago
10 <link rel="stylesheet" href="https://esm.town/v/Onujules/my-first-val@main/frontend/style.css" />
11 <style>
12 @import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700&display=swap');
13
14 body {

Glanceriframe.tsx3 matches

@lightweightโ€ขUpdated 3 days ago
19 src="https://glance--90537b2ecab54268bf831875fe1d0158.web.val.run"
20 // src="https://lightweight--ef4179e03fc011f0bc0c76b3cceeab13.web.val.run"
21 // src="/api/iframe"
22 // src={`/api/${content}`}
23 // src={`/api/${content}?user=${userId}`}
24 // src={contentURL}
25 title={`Glance content: ${content}`}

fotmobindex.html6 matches

@cemugur70โ€ขUpdated 3 days ago
469
470 // Send to backend for analysis
471 const response = await fetch('/api/analyze', {
472 method: 'POST',
473 headers: {
563
564 try {
565 const response = await fetch('/api/analyze', {
566 method: 'POST',
567 headers: {
674
675 try {
676 const response = await fetch('/api/export/full', {
677 method: 'POST',
678 headers: { 'Content-Type': 'application/json' },
701
702 try {
703 const response = await fetch('/api/export/iddaa', {
704 method: 'POST',
705 headers: { 'Content-Type': 'application/json' },
728
729 try {
730 const response = await fetch('/api/export/poisson', {
731 method: 'POST',
732 headers: { 'Content-Type': 'application/json' },
755
756 try {
757 const response = await fetch('/api/export/accuracy', {
758 method: 'POST',
759 headers: { 'Content-Type': 'application/json' },

fotmobindex.ts6 matches

@cemugur70โ€ขUpdated 3 days ago
54} | null = null;
55
56// Analysis API endpoint
57app.post("/api/analyze", async c => {
58 try {
59 const request: AnalysisRequest = await c.req.json();
90
91// Excel export endpoints
92app.post("/api/export/full", async c => {
93 try {
94 const { targetWeek } = await c.req.json();
122});
123
124app.post("/api/export/iddaa", async c => {
125 try {
126 const { targetWeek } = await c.req.json();
154});
155
156app.post("/api/export/poisson", async c => {
157 try {
158 const { targetWeek } = await c.req.json();
186});
187
188app.post("/api/export/accuracy", async c => {
189 try {
190 if (!globalAnalysisData) {

fotmobREADME.md1 match

@cemugur70โ€ขUpdated 3 days ago
18โ”‚ โ”œโ”€โ”€ index.ts # Main HTTP server
19โ”‚ โ””โ”€โ”€ routes/
20โ”‚ โ””โ”€โ”€ analysis.ts # Analysis API endpoints
21โ”œโ”€โ”€ frontend/
22โ”‚ โ”œโ”€โ”€ index.html # Main application interface

LiveStormMCPREADME.md10 matches

@supagroovaโ€ขUpdated 3 days ago
1# Livestorm API MCP Server
2
3This project creates a Model Context Protocol (MCP) server that wraps the
4Livestorm API, exposing:
5
6- GET endpoints as Resources
9## How it works
10
111. The server fetches and parses the Livestorm API's OpenAPI definition
122. It dynamically creates MCP Resources and Tools based on the API endpoints
133. When a client requests a Resource or Tool, the server proxies the request to
14 the Livestorm API
15
16## MCP Definition
24{
25 "mcpServers": {
26 "livestorm-api": {
27 "type": "streamable-http",
28 "url": "https://supagroova--7fab7ae4322911f080e9569c3dd06744.web.val.run/mcp",
38{
39 "mcpServers": {
40 "livestorm-api": {
41 "type": "sse",
42 "serverUrl": "https://supagroova--7fab7ae4322911f080e9569c3dd06744.web.val.run/sse"
49
50- `index.ts`: Main entry point with HTTP trigger
51- `livestorm.ts`: Functions to fetch and parse the OpenAPI definition
52- `mcp.ts`: MCP server setup and configuration
53
67RUN_LOCAL=1
68PORT=8787
69LIVESTORM_API_TOKEN=your-livestorm-api-token-here
70```
71
72This is useful for API tokens and local configuration.
73
74You can run this MCP server locally using the [Deno](https://deno.land/)

LiveStormMCPcreate_event_endpoint.json4 matches

@supagroovaโ€ขUpdated 3 days ago
10 "security": [
11 {
12 "api_key": []
13 },
14 {
21 "description": "Created",
22 "content": {
23 "application/vnd.api+json": {
24 "schema": {
25 "type": "object",
207 },
208 "examples": {
209 "application/vnd.api+json": {
210 "value": {
211 "data": {
343 "requestBody": {
344 "content": {
345 "application/vnd.api+json": {
346 "schema": {
347 "type": "object",

LiveStormMCPtypes.ts3 matches

@supagroovaโ€ขUpdated 3 days ago
1
2// Types for OpenAPI schema
3export interface OpenApiSchema {
4 paths: Record<string, PathItem>;
5 // Other OpenAPI properties we might need
6}
7

LiveStormMCPmcp.ts16 matches

@supagroovaโ€ขUpdated 3 days ago
6 extractGetEndpoints,
7 extractMutationEndpoints,
8 fetchOpenApiSpec,
9 proxyRequest,
10} from "../src/livestorm.ts";
28
29/**
30 * Sets up the MCP server with resources and tools based on the Livestorm API
31 * Uses a cached instance if available
32 */
39 // Create a new MCP server
40 const server = new McpServer({
41 name: "livestorm-api-server",
42 version: "1.0.0",
43 description: "MCP server that provides access to Livestorm API endpoints",
44 }, { capabilities: { logging: {} } });
45
46 try {
47 console.log("Fetching Livestorm API OpenAPI spec...");
48 // Fetch the OpenAPI spec
49 const openApiSpec = await fetchOpenApiSpec();
50
51 // Extract GET endpoints (Resources)
52 const getEndpoints = extractGetEndpoints(openApiSpec);
53
54 // Extract mutation endpoints (Tools)
55 const mutationEndpoints = extractMutationEndpoints(openApiSpec);
56
57 // Register Resources
127 }
128
129 // Make the request to the Livestorm API
130 const response = await proxyRequest(
131 path,
137 const errorText = await response.text();
138 throw new Error(
139 `Livestorm API error: ${response.status} ${response.statusText} - ${errorText}`,
140 );
141 }
236 }
237
238 // Make the request to the Livestorm API
239 const response = await proxyRequest(
240 path,
247 const errorText = await response.text();
248 throw new Error(
249 `Livestorm API error: ${response.status} ${response.statusText} - ${errorText}`,
250 );
251 }
283
284/**
285 * Creates a tool schema from an OpenAPI operation
286 * Returns an object with input and output schemas using Zod
287 *
314
315 const requestSchema = operation.requestBody
316 ?.content["application/vnd.api+json"]?.schema;
317 const responseSchema = operation.responses["201"]
318 ?.content["application/vnd.api+json"]?.schema?.properties?.data.allOf[1];
319
320 // Iterate through the schema elements and add those to the inputSchema as Zod types

LiveStormMCPlivestorm.ts34 matches

@supagroovaโ€ขUpdated 3 days ago
1import "https://deno.land/std@0.224.0/dotenv/load.ts";
2import { parse as parseYaml } from "https://esm.sh/yaml@2.3.1";
3import { OpenApiSchema, OperationObject } from "./types.ts";
4import { blob } from "https://esm.town/v/std/blob";
5import { ValTownBlobNotFoundError } from "https://esm.town/v/std/ValTownBlobNotFoundError";
6import { ValTownBlobError } from "https://esm.town/v/std/ValTownBlobError";
7
8// URL of the Livestorm API OpenAPI definition
9const LIVESTORM_API_SPEC_URL =
10 "https://api.livestorm.co/api-docs/v1/swagger.yaml";
11const LIVESTORM_API_BASE_URL = "https://api.livestorm.co/v1";
12
13// Cache key for storing the OpenAPI spec in Blob storage
14const OPENAPI_SPEC_CACHE_KEY = "livestorm-openapi-spec";
15
16/**
17 * Fetches the Livestorm API OpenAPI definition
18 */
19export async function fetchOpenApiSpec(): Promise<OpenApiSchema> {
20 try {
21 // Check if the OpenAPI spec is cached in Blob storage
22 let response;
23 try {
24 response = await blob.get(OPENAPI_SPEC_CACHE_KEY);
25 console.log(`Using cached OpenAPI spec from Blob storage`);
26 } catch (e) {
27 if (
28 e instanceof ValTownBlobNotFoundError || e instanceof ValTownBlobError
29 ) {
30 console.log(`Fetching OpenAPI spec from ${LIVESTORM_API_SPEC_URL}...`);
31 response = await fetch(LIVESTORM_API_SPEC_URL);
32 if (!response.ok) {
33 const errorText = await response.text();
34 console.error(
35 `Failed to fetch OpenAPI spec: ${response.status} ${response.statusText}`,
36 );
37 console.error(`Response body: ${errorText}`);
38 throw new Error(
39 `Failed to fetch OpenAPI spec: ${response.status} ${response.statusText}`,
40 );
41 }
46
47 const yamlText = await response.text();
48 let parsedSpec: OpenApiSchema;
49 try {
50 parsedSpec = parseYaml(yamlText);
51 // Validate the parsed spec has the expected structure
52 if (!parsedSpec || !parsedSpec.paths) {
53 throw new Error("Invalid OpenAPI spec: missing paths property");
54 }
55 } catch (parseError) {
56 console.error("Error parsing OpenAPI spec YAML:", parseError);
57 throw new Error(
58 `Failed to parse OpenAPI spec: ${
59 parseError instanceof Error ? parseError.message : String(parseError)
60 }`,
62 }
63
64 // Cache the OpenAPI spec in Blob storage
65 try {
66 await blob.set(OPENAPI_SPEC_CACHE_KEY, yamlText);
67 } catch (e) {
68 console.error("Error caching OpenAPI spec:", e);
69 }
70
71 return parsedSpec;
72 } catch (error) {
73 console.error("Error fetching OpenAPI spec:", error);
74 throw error;
75 }
77
78/**
79 * Extracts GET endpoints from the OpenAPI spec
80 */
81export function extractGetEndpoints(spec: OpenApiSchema) {
82 const getEndpoints: Record<
83 string,
99
100/**
101 * Extracts POST, PUT, DELETE endpoints from the OpenAPI spec
102 */
103export function extractMutationEndpoints(spec: OpenApiSchema) {
104 const mutationEndpoints: Record<
105 string,
148
149/**
150 * Proxies a request to the Livestorm API
151 */
152export async function proxyRequest(
157): Promise<Response> {
158 // Replace path parameters in the URL
159 let url = `${LIVESTORM_API_BASE_URL}${path}`;
160
161 // Extract path parameters and replace them in the URL
193
194 // Forward the Authorization header
195 const authHeader = Deno.env.get("LIVESTORM_API_TOKEN");
196 if (!authHeader) {
197 throw new Error(
198 "Authorization header is required for Livestorm API requests",
199 );
200 }
222
223 try {
224 // Make the request to Livestorm API
225 const response = await fetch(url, requestOptions);
226
230 console.error(`Error proxying request to ${url}:`, error);
231 throw new Error(
232 `Failed to proxy request to Livestorm API: ${
233 error instanceof Error ? error.message : String(error)
234 }`,

github-api1 file match

@cricks_unmixed4uโ€ขUpdated 20 hours ago

beeminder-api4 file matches

@cricks_unmixed4uโ€ขUpdated 21 hours ago
Kapil01
apiv1