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=1653&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 18154 results for "api"(6296ms)

postWebhookTestmain.tsx1 match

@ggarnhart•Updated 1 year ago
2
3export let postWebhookTest = fetchJSON(
4 "https://api.val.town/express/@ggarnhart.citiBikeSpotChecker",
5 {
6 method: "POST",

chatSampleFunctionSinglemain.tsx1 match

@webup•Updated 1 year ago
4export const chatSampleFunctionSingle = (async () => {
5 // Example dummy function hard coded to return the same weather
6 // In production, this could be your backend API or an external API
7 const getCurrentWeather = (location, unit = "fahrenheit") => ({
8 unit,

chatmain.tsx4 matches

@steveb1313•Updated 1 year ago
6 options = {},
7) => {
8 // Initialize OpenAI API stub
9 const { Configuration, OpenAIApi } = await import("https://esm.sh/openai");
10 const configuration = new Configuration({
11 apiKey: process.env.openAIAPI,
12 });
13 const openai = new OpenAIApi(configuration);
14 // Request chat completion
15 const messages = typeof prompt === "string"

captureCalendlyWebhookmain.tsx1 match

@ianvph•Updated 1 year ago
21 };
22 capturePostHogEvent(
23 process.env.phProjectAPIKey,
24 user,
25 eventName,

myApimain.tsx1 match

@MattPayneOrg•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

bigLeagueMemain.tsx1 match

@nuklearfiziks•Updated 1 year ago
1export const bigLeagueMe = async (req: Request) => {
2 const params = Object.fromEntries(new URL(req.url).searchParams.entries());
3 var {default: atproto} = await import("npm:@atproto/api");
4
5 const BskyAgent = atproto.

createQdrantCollectionmain.tsx2 matches

@wilt•Updated 1 year ago
3/**
4 * Create a new Qdrant collection in an existing cluster with the given name
5 * Uses recommended values for OpenAPI embeddings
6 */
7export async function createQdrantCollection(args: {
16 method: "PUT",
17 headers: {
18 "api-key": qdrantKey,
19 "Content-Type": "application/json",
20 },

sendRandomChihuahuaToSlackmain.tsx4 matches

@metart43•Updated 1 year ago
3
4export async function sendRandomChihuahuaToSlack() {
5 const dogAPIURL = new URL(
6 "https://dog.ceo/api/breed/chihuahua/images/random",
7 );
8 const dogApiResp = await fetch(dogAPIURL.href);
9 const { message } = await dogApiResp.json();
10 const res = await fetch(process.env.BROOKLAND_SLACK_WEBHOOK_URL, {
11 method: "POST",

valToStringmain.tsx1 match

@sdan•Updated 1 year ago
6 }
7 const [author, name] = val.split(".");
8 const resp = await fetch(`https://api.val.town/v1/alias/${author}/${name}`);
9 if (resp.status !== 200) {
10 throw new Error(resp.statusText);

measureValTownE2emain.tsx2 matches

@tmcw•Updated 1 year ago
8 for (let i = 0; i < count; i++) {
9 let start = Date.now();
10 await fetch("https://api.val.town/eval/(()=%3E1+1)()");
11 evalTimes.push(Date.now() - start);
12 }
23 for (let i = 0; i < count; i++) {
24 let start = Date.now();
25 await fetch("https://api.val.town/eval/@healeycodes.addOnes()");
26 userFuncTimes.push(Date.now() - start);
27 }

xxxclearinghouse_validator

@toowired•Updated 5 hours ago
Request validator for clearance API

Apiify11 file matches

@wolf•Updated 23 hours ago
Kapil01
apiv1