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=775&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 10974 results for "api"(1283ms)

githubActivityReportmain.tsx1 match

@elliotbraem•Updated 9 months ago
14 }
15
16 const response = await fetch(`https://api.github.com/users/${userName}/events`);
17 const events = await response.json();
18

switchbotmain.tsx3 matches

@stevekrouse•Updated 9 months ago
1// This val creates a simple web interface for opening the Val Town office door.
2// It uses the Hono framework for routing and HTML rendering, and interacts with
3// the SwitchBot API to control the door. The approach includes:
4// 1. A frontend route that displays a button to open the door
5// 2. A backend route that handles the door opening request
6// 3. Integration with SwitchBot API for door control
7// 4. Basic error handling and email notification on failure
8
29 .toString("base64");
30
31 const response = await fetch(`https://api.switch-bot.com/${path}`, {
32 headers: {
33 "Authorization": token,

switchbotmain.tsx3 matches

@stevekrouse•Updated 9 months ago
1// This val creates a simple web interface for opening the Val Town office door.
2// It uses the Hono framework for routing and HTML rendering, and interacts with
3// the SwitchBot API to control the door. The approach includes:
4// 1. A frontend route that displays a button to open the door
5// 2. A backend route that handles the door opening request
6// 3. Integration with SwitchBot API for door control
7// 4. Basic error handling and email notification on failure
8
29 .toString("base64");
30
31 const response = await fetch(`https://api.switch-bot.com/${path}`, {
32 headers: {
33 "Authorization": token,

githubActivityReportREADME.md1 match

@elliotbraem•Updated 9 months ago
15## Response Structure
16
17The API returns a JSON response body with the following structure:
18
19```json

bbrunmain.tsx1 match

@dglazkov•Updated 9 months ago
131
132const boardToEndpoint = (board: string) => {
133 return board.replace(/\.json$/, ".api/run");
134};
135

bbrunREADME.md2 matches

@dglazkov•Updated 9 months ago
4
5For now, requires you to be running a board server. This harness actually acts
6as a proxy to the board server [run API endpoint](https://breadboard-ai.github.io/breadboard/docs/reference/board-run-api-endpoint/),
7and puts a nice (well, somewhat nice) frontend on top of it.
8
11
12The script will look for the `BB_LIVE_KEY` in your Val Town environment, which
13must contain your board server API key.
14
15To use, create an HTTP val, then import the `proxy` function from this script and call it like this:

myTablemain.tsx1 match

@hello_mikkie•Updated 9 months ago
2
3const airtable = new Airtable({
4 apiKey: Deno.env.get("airtable_pat"),
5 baseId: "app0TOKIOXvF3zoS2",
6 tableName: "tblRJj6ty16uR9QhC",

animemain.tsx9 matches

@tempguy•Updated 9 months ago
11 const results = [];
12 const metaResponse = await fetch(
13 `https://cool-proxy.koyeb.app/hdiuhmalkmc9d0ck7UCFVGBJHN?destination=https://api.malsync.moe/mal/anime/${id}`,
14 );
15 const metaData = await metaResponse.json();
22 const episodeIdentifier = `${data.identifier}-episode-${ep}`;
23 return [
24 fetch(`https://animetize-api.vercel.app/servers/${episodeIdentifier}`),
25 fetch(`https://animetize-api.vercel.app/watch/${episodeIdentifier}`),
26 ];
27 }
67 <title>${metaData.title}</title>
68 <style>
69 @import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;700&display=swap');
70
71 html,
159 const results = [];
160 const metaResponse = await fetch(
161 `https://cool-proxy.koyeb.app/hdiuhmalkmc9d0ck7UCFVGBJHN?destination=https://api.malsync.moe/mal/anime/${id}`,
162 );
163 const metaData = await metaResponse.json();
169 const episodeIdentifier = `${data.identifier}-episode-${ep}`;
170 return [
171 fetch(`https://animetize-api.vercel.app/servers/${episodeIdentifier}`),
172 fetch(`https://animetize-api.vercel.app/watch/${episodeIdentifier}`),
173 ];
174 }
217 <body style="background:#111;color:#DDD;">
218 <h1>Tempguy-Anime</h1>
219 <pre>https://tempguy-anime.web.val.run/api/MAL_ID/EPISODE/(sub/dub)</pre>
220 <pre>https://tempguy-anime.web.val.run/api/21/1/dub</pre>
221 </body>,
222 );

askAImain.tsx2 matches

@DFB•Updated 9 months ago
1import { OpenAI } from "https://deno.land/x/openai@v4.54.0/mod.ts";
2
3const apiKey = Deno.env.get("OPENAI_API_KEY");
4const openai = new OpenAI({ apiKey });
5
6export async function askAI(msg: string) {

blink_create_treemain.tsx3 matches

@nickfrosty•Updated 9 months ago
10 ActionPostRequest,
11} from "@solana/actions";
12import { clusterApiUrl } from "@solana/web3.js";
13import { createTree } from "@metaplex-foundation/mpl-bubblegum";
14import { toWeb3JsTransaction } from "@metaplex-foundation/umi-web3js-adapters";
36 {
37 label: "Create Tree",
38 href: "/api/actions/create-tree?depth={depth}&buffer={buffer}&canopy={canopy}",
39 parameters: [
40 {
112 }
113
114 const umi = createUmi(clusterApiUrl("devnet"));
115 // .use(
116 // signerPayer(createNoopSigner(account)),

daily-advice-app1 file match

@dcm31•Updated 2 days ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaine•Updated 3 days ago
apiv1
papimark21