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=1&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 14776 results for "api"(675ms)

untitled-923index.ts4 matches

@Piyush1234•Updated 1 hour ago
25});
26
27// API endpoints for future enhancements
28app.get("/api/programs", c => {
29 const programs = [
30 {
60});
61
62app.post("/api/contact", async c => {
63 const body = await c.req.json();
64
73
74// Health check endpoint
75app.get("/api/health", c => {
76 return c.json({ status: "healthy", timestamp: new Date().toISOString() });
77});

untitled-923Hero.tsx1 match

@Piyush1234•Updated 1 hour ago
20 <p className="text-xl md:text-2xl mb-8 max-w-3xl mx-auto leading-relaxed">
21 Excellence in Education, Innovation in Learning.
22 Shaping tomorrow's leaders in Management and Science.
23 </p>
24

charmaineValSearchcomponents.tsx8 matches

@charmaine•Updated 1 hour ago
1043 <link rel="icon" href="https://fav.farm/👀" />
1044 <meta name="viewport" content="width=device-width, initial-scale=1" />
1045 <link rel="preconnect" href="https://fonts.googleapis.com" />
1046 <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
1047 <link
1048 href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&display=swap"
1049 rel="stylesheet"
1050 />
1061 <a href="https://val.town" className="valtown-link" style={{ marginLeft: "auto" }}>Return to Val Town</a>
1062 </h1>
1063 <div className="api-info">
1064 <details>
1065 <summary>API Access</summary>
1066 <div className="api-docs">
1067 <p>
1068 You can access search results via JSON API by adding <code>format=json</code> to your query:
1069 </p>
1070 {searchTerm
1222 <div className="search-examples">
1223 <a href="?q=fetch" className="example-link">fetch</a>
1224 <a href="?q=api" className="example-link">api</a>
1225 <a href="?q=database" className="example-link">database</a>
1226 <a href="?q=image" className="example-link">image</a>
1376 <div className="search-examples">
1377 <a href="?q=fetch" className="example-link">fetch</a>
1378 <a href="?q=api" className="example-link">api</a>
1379 <a href="?q=database" className="example-link">database</a>
1380 <a href="?q=image" className="example-link">image</a>

GitHubSyncREADME.md3 matches

@johnnyclem•Updated 2 hours ago
24 - Ensure the token has read/write access to _Contents_ for the repo
25 - Copy the access token and add that as the `GITHUB_TOKEN` env var in this val
261. Add a new [Val Town API token][] with read/write permissions. Add that token to the val's env vars as `VALTOWN_TOKEN`
271. Add a `VAL_SECRET` env var to the val. Use this secret to sign the webhook POST request to the `/push` endpoint. Use this endpoint to commit vals from Val Town to your GitHub repo.
28
68
69- `GITHUB_TOKEN`: Read/write GitHub personal access token for reading and writing repo contents
70- `VALTOWN_TOKEN`: ValTown API token (with read/write Vals permissions) for writing updates from GitHub
71- `GITHUB_WEBHOOK_SECRET`: secret for verifying webhooks from GitHub
72- `VAL_SECRET`: secret for verifying requests to the `/push` endpoint
98[github oauth app]: https://github.com/settings/developers
99[access token]: https://github.com/settings/tokens
100[val town api token]: https://www.val.town/settings/api
101[troubleshooting]: #troubleshooting
102

templateTwitterAlertREADME.md4 matches

@johnnyclem•Updated 2 hours ago
31Refer to [Twitter's search operators](https://socialdata.gitbook.io/docs/twitter-tweets/retrieve-search-results-by-keyword#endpoint-parameters) to fine-tune your query.
32
33### 4. Test API call
34Set `isProd = false` in the code if you are testing, to ensure there are enough tweets to display. <br>
35Toggle it back to `true` when you're ready to run this cron job in production and actuall send notifications.
60
61### NOTE: Usage Limits
62This val uses the SocialData API for Twitter data:
63
64- **Proxies via Val Town's [SocialDataProxy](https://www.val.town/v/stevekrouse/socialDataProxy)**: Limited to 10 cents per day for [**Val Town Pro users**](https://www.val.town/pricing). This API is *only* for Pro users.
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.

LiveStormMCPmcp.ts16 matches

@supagroova•Updated 2 hours ago
1import { McpServer, ResourceTemplate } from "npm:@modelcontextprotocol/sdk/server/mcp.js";
2import { extractGetEndpoints, extractMutationEndpoints, fetchOpenApiSpec, proxyRequest } from "./livestorm.ts";
3import { z } from "npm:zod";
4import type { OperationObject, SchemaObject } from "./types.ts";
20
21/**
22 * Sets up the MCP server with resources and tools based on the Livestorm API
23 * Uses a cached instance if available
24 */
31 // Create a new MCP server
32 const server = new McpServer({
33 name: "livestorm-api-server",
34 version: "1.0.0",
35 description: "MCP server that provides access to Livestorm API endpoints",
36 },
37 { capabilities: { logging: {} } });
38
39 try {
40 console.log("Fetching Livestorm API OpenAPI spec...");
41 // Fetch the OpenAPI spec
42 const openApiSpec = await fetchOpenApiSpec();
43
44 // Extract GET endpoints (Resources)
45 const getEndpoints = extractGetEndpoints(openApiSpec);
46
47 // Extract mutation endpoints (Tools)
48 const mutationEndpoints = extractMutationEndpoints(openApiSpec);
49
50 // Register Resources
123 }
124
125 // Make the request to the Livestorm API
126 const response = await proxyRequest(
127 path,
132 if (!response.ok) {
133 const errorText = await response.text();
134 throw new Error(`Livestorm API error: ${response.status} ${response.statusText} - ${errorText}`);
135 }
136
215 }
216
217 // Make the request to the Livestorm API
218 const response = await proxyRequest(
219 path,
225 if (!response.ok) {
226 const errorText = await response.text();
227 throw new Error(`Livestorm API error: ${response.status} ${response.statusText} - ${errorText}`);
228 }
229
255 // Convert to title case
256 .replace(/^[a-z]+/, (verb) => verb.charAt(0).toUpperCase() + verb.slice(1))
257 // Replace underscores with spaces and capitalize each word
258 .replace(/_/g, ' ');
259}
260
261/**
262 * Creates a Zod schema from an OpenAPI schema object
263 */
264function createZodSchema(schemaObj?: SchemaObject): ZodTypeAny {
315
316/**
317 * Creates a tool schema from an OpenAPI operation
318 * Returns an object with input and output schemas using Zod
319 *

LiveStormMCPtypes.ts3 matches

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

nightbot-master-commandnew-file-9775.tsx4 matches

@jayden•Updated 3 hours ago
41 advice: async () => {
42 console.log("handler.advice");
43 const res = await fetch("https://api.adviceslip.com/advice");
44 if (!res.ok) {
45 console.error("advice fetch failed", res.status);
64 trivia: async () => {
65 console.log("handler.trivia");
66 const res = await fetch("http://numbersapi.com/random/trivia?json");
67 if (!res.ok) {
68 console.error("trivia fetch failed", res.status);
74 compliment: async () => {
75 console.log("handler.compliment");
76 const res = await fetch("https://complimentr.com/api");
77 if (!res.ok) {
78 console.error("compliment fetch failed", res.status);
215
216 try {
217 const res = await fetch(`https://ohmanda.com/api/horoscope/${sign}`);
218 if (!res.ok) {
219 console.error("horoscope fetch failed", res.status);

LiveStormMCPlivestorm.ts32 matches

@supagroova•Updated 3 hours ago
1import { parse as parseYaml } from 'https://esm.sh/yaml@2.3.1';
2import { OpenApiSchema, OperationObject } from './types.ts';
3import { blob } from "https://esm.town/v/std/blob";
4import { ValTownBlobNotFoundError } from "https://esm.town/v/std/ValTownBlobNotFoundError";
5
6// URL of the Livestorm API OpenAPI definition
7const LIVESTORM_API_SPEC_URL = 'https://api.livestorm.co/api-docs/v1/swagger.yaml';
8const LIVESTORM_API_BASE_URL = 'https://api.livestorm.co/v1';
9
10// Cache key for storing the OpenAPI spec in Blob storage
11const OPENAPI_SPEC_CACHE_KEY = 'livestorm-openapi-spec';
12
13/**
14 * Fetches the Livestorm API OpenAPI definition
15 */
16export async function fetchOpenApiSpec(): Promise<OpenApiSchema> {
17 try {
18 // Check if the OpenAPI spec is cached in Blob storage
19 let response;
20 try {
21 response = await blob.get(OPENAPI_SPEC_CACHE_KEY);
22 console.log(`Using cached OpenAPI spec from Blob storage`);
23 } catch (e) {
24 if (e instanceof ValTownBlobNotFoundError) {
25 console.log(`Fetching OpenAPI spec from ${LIVESTORM_API_SPEC_URL}...`);
26 response = await fetch(LIVESTORM_API_SPEC_URL);
27 if (!response.ok) {
28 const errorText = await response.text();
29 console.error(`Failed to fetch OpenAPI spec: ${response.status} ${response.statusText}`);
30 console.error(`Response body: ${errorText}`);
31 throw new Error(`Failed to fetch OpenAPI spec: ${response.status} ${response.statusText}`);
32 }
33 } else {
39
40 try {
41 const parsedSpec = parseYaml(yamlText) as OpenApiSchema;
42
43 // Validate the parsed spec has the expected structure
44 if (!parsedSpec || !parsedSpec.paths) {
45 throw new Error('Invalid OpenAPI spec: missing paths property');
46 }
47
48 // Cache the OpenAPI spec in Blob storage
49 await blob.set(OPENAPI_SPEC_CACHE_KEY, yamlText);
50
51 return parsedSpec;
52 } catch (parseError) {
53 console.error('Error parsing OpenAPI spec YAML:', parseError);
54 console.error('YAML content (first 500 chars):', yamlText.substring(0, 500));
55 throw new Error(`Failed to parse OpenAPI spec: ${parseError instanceof Error ? parseError.message : String(parseError)}`);
56 }
57 } catch (error) {
58 console.error('Error fetching OpenAPI spec:', error);
59 throw error;
60 }
62
63/**
64 * Extracts GET endpoints from the OpenAPI spec
65 */
66export function extractGetEndpoints(spec: OpenApiSchema) {
67 const getEndpoints: Record<string, { path: string; operation: OperationObject }> = {};
68
80
81/**
82 * Extracts POST, PUT, DELETE endpoints from the OpenAPI spec
83 */
84export function extractMutationEndpoints(spec: OpenApiSchema) {
85 const mutationEndpoints: Record<string, { method: string; path: string; operation: OperationObject }> = {};
86
119
120/**
121 * Proxies a request to the Livestorm API
122 */
123export async function proxyRequest(
128): Promise<Response> {
129 // Replace path parameters in the URL
130 let url = `${LIVESTORM_API_BASE_URL}${path}`;
131
132 // Extract path parameters and replace them in the URL
157
158 // Forward the Authorization header
159 const authHeader = Deno.env.get("LIVESTORM_API_TOKEN");
160 if (!authHeader) {
161 throw new Error('Authorization header is required for Livestorm API requests');
162 }
163 requestHeaders.set('Authorization', authHeader);
180
181 try {
182 // Make the request to Livestorm API
183 const response = await fetch(url, requestOptions);
184
187 } catch (error) {
188 console.error(`Error proxying request to ${url}:`, error);
189 throw new Error(`Failed to proxy request to Livestorm API: ${error instanceof Error ? error.message : String(error)}`);
190 }
191}

charmaineValSearchimport.ts1 match

@charmaine•Updated 3 hours ago
39 profile_image_url: user.profileImageUrl,
40 url: user.url,
41 updated_at: new Date().toISOString(), // Using current time as the API doesn't provide updated_at
42 });
43

book-lookup-notion6 file matches

@nucky•Updated 11 hours ago
use google book api to look up bibliographic metadata elements

openai_api_project_Pauline2 file matches

@Paulineseemann•Updated 12 hours ago
Kapil01
apiv1