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/$%7BsvgDataUrl%7D?q=api&page=6&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 18960 results for "api"(2737ms)

NewPerspctovologyAppmain.tsx2 matches

@hxseidman•Updated 15 hours ago
1// val.js
2
3const OPENAI_API_KEY = process.env.OPENAI_API_KEY; // set this later
4
5export default async (req, res) => {
13 }
14
15 // 🧠 Optional: Call your GPT API here (if you want real answers)
16 // Example:
17 // const response = await fetch("https://YOUR-GPT-ENDPOINT", ...)

invest-trackercrypto_news_cron.tsx1 match

@samxii777•Updated 15 hours ago
9 /* 1 â–¸ fetch 10 freshest business headlines that mention our coins */
10 const q = encodeURIComponent(COINS.slice(0, 3).join(" OR "));
11 const url = `https://newsdata.io/api/1/latest?apikey=${KEY}`
12 + `&q=${q}&language=en&size=10&category=business`;
13

untitled-6658HTTP.tsx2 matches

@MrStealer_Offical•Updated 15 hours ago
10 />
11 <link
12 href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
13 rel="stylesheet"
14 />
64 class="rounded-md w-[120px] h-[180px] object-cover flex-shrink-0"
65 height="180"
66 src="https://storage.googleapis.com/a1aa/image/da09cbc2-570f-460a-05bb-9836a9055c79.jpg"
67 width="120"
68 />

invest-trackermacro_news_daily.tsx3 matches

@samxii777•Updated 16 hours ago
1import { blob } from "https://esm.town/v/std/blob";
2const KEY = Deno.env.get("NEWSAPI");
3
4export default async function run() {
5 const query = `https://newsapi.org/v2/everything?`
6 + `q=(${
7 encodeURIComponent(`
9 AND (United States OR Australia OR Europe OR China)
10 `)
11 })&language=en&sortBy=publishedAt&pageSize=10&apiKey=${KEY}`;
12
13 const arts = (await fetch(query).then(r => r.json())).articles ?? [];

beeminder-apicall_beeminder_api.sh0 matches

@cricks_unmixed4u•Updated 16 hours ago
1#!/bin/sh
2# Write JSON payload to file
3# cat <<EOF > datapoint.json
4# {"value": 2.5, "comment": "Test from file", "goal": "walk"}
5# EOF

beeminder-apimain.tsx6 matches

@cricks_unmixed4u•Updated 16 hours ago
1// Beeminder API Handler for Val Town
2// Requires environment variables: BEEMINDER_TOKEN
3// Goal slug can be provided via environment variable BEEMINDER_GOAL_SLUG or JSON request parameter
52 const authToken = token || Deno.env.get('BEEMINDER_TOKEN');
53 const goalSlug = datapoint.goal || defaultGoalSlug || Deno.env.get('BEEMINDER_GOAL_SLUG');
54 const baseUrl = 'https://www.beeminder.com/api/v1';
55
56 if (!authToken) {
100): Promise<any> {
101 const authToken = token || Deno.env.get('BEEMINDER_TOKEN');
102 const baseUrl = 'https://www.beeminder.com/api/v1';
103
104 if (!authToken) {
176 }
177
178 const baseUrl = 'https://www.beeminder.com/api/v1';
179
180 try {
181 // Handle different API endpoints
182 switch (path) {
183 case '/':
184 return new Response(JSON.stringify({
185 message: 'Beeminder API Handler',
186 endpoints: {
187 'GET /goal': 'Get goal information (requires goal parameter in JSON body or BEEMINDER_GOAL_SLUG env var)',

gissue-rolodexApp.tsx1 match

@cricks_unmixed4u•Updated 16 hours ago
21
22 try {
23 const response = await fetch("/api/config", {
24 method: "POST",
25 headers: {

mcp-starterREADME.md1 match

@nbbaier•Updated 16 hours ago
30## What is the adapter for?
31
32The MCP TypeScript SDK uses Node-specific APIs that don't play nicely with Deno
33or edge functions:
34

gissue-rolodexindex.ts3 matches

@cricks_unmixed4u•Updated 16 hours ago
17});
18
19// API endpoint to handle refresh frequency configuration
20app.post("/api/config", async c => {
21 try {
22 const body = await c.req.json();
43
44// Health check endpoint
45app.get("/api/health", c => {
46 return c.json({ status: "ok", timestamp: new Date().toISOString() });
47});

honoExampleBkndREADME.md2 matches

@dswbx•Updated 17 hours ago
1# Hono
2
3Here's an example using the [Hono](https://hono.dev/) server library with the [Web API](https://docs.val.town/api/web). It works great!
4
5
11- [Nhttp](https://www.val.town/v/tmcw.nhttpExample)
12
13Migrated from folder: Web_API/honoExample

beeminder-api4 file matches

@cricks_unmixed4u•Updated 16 hours ago

shippingAPI1 file match

@dynamic_silver•Updated 1 day ago
apiry
snartapi