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/image-url.jpg?q=api&page=1463&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 18131 results for "api"(2518ms)

ruralCrimsonGuppymain.tsx2 matches

@jamisonl•Updated 9 months ago
2import { blob } from "https://esm.town/v/std/blob";
3// Bump version
4import { Routes } from "npm:@discord-api-types/v9";
5import { REST } from "npm:@discordjs/rest";
6import { createAudioPlayer, createAudioResource, joinVoiceChannel } from "npm:@discordjs/voice";
7import googleTTS from "npm:google-tts-api";
8let bank = await blob.getJSON("bank");
9let bets = await blob.getJSON("bets");

valTopicGenmain.tsx1 match

@roramigator•Updated 9 months ago
17 "Collaborative Whiteboard",
18 "Cryptocurrency Price Tracker",
19 "Custom API Wrapper",
20 "Data Visualization Dashboard",
21 "Distributed Computing Project",

aloneBronzeCattlemain.tsx2 matches

@jamisonl•Updated 9 months ago
4import { REST } from "@discordjs/rest";
5import { createAudioPlayer, createAudioResource, joinVoiceChannel } from "@discordjs/voice";
6import { Routes } from "discord-api-types/v9";
7import googleTTS from "google-tts-api";
8let bank = await blob.getJSON("bank");
9let bets = await blob.getJSON("bets");

darkMagentaFlamingomain.tsx1 match

@jamisonl•Updated 9 months ago
6import { createAudioResource, createAudioPlayer, joinVoiceChannel, VoiceConnectionStatus } from '@discordjs/voice';
7import { Client, GatewayIntentBits } from 'discord.js';
8import googleTTS from 'google-tts-api';
9const starting_amount = 5;
10const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildVoiceStates] });

convenientAzureSparrowmain.tsx4 matches

@gio•Updated 9 months ago
1const axios = require("axios");
2
3// Your Telnyx API Key
4const apiKey = "your_api_key";
5
6// Function to send SMS
8 try {
9 const response = await axios.post(
10 "https://api.telnyx.com/v2/messages",
11 {
12 from: from, // Your Telnyx phone number
16 {
17 headers: {
18 "Authorization": `Bearer ${apiKey}`,
19 "Content-Type": "application/json",
20 },

lucia_middlewaremain.tsx3 matches

@yawnxyz•Updated 9 months ago
246 try {
247 const tokens = await github.validateAuthorizationCode(code);
248 const githubUserResponse = await fetch("https://api.github.com/user", {
249 headers: {
250 Authorization: `Bearer ${tokens.accessToken}`
345 const code = c.req.query("code");
346
347 // https://yawnxyz-hncloneluciaoauth.web.val.run/auth/google/callback?state=e1ntsxqPFLaBZe9tXQ7SwwGHJ5Cr2nAvwNtWtQNtRVk&code=4%2F0AQlEd8yAzO8cETotI28YAdDu7kMaWfwsBY6mBLtA3Mz0dO0-REGYfsHQcNsQzw1bE1mNyA&scope=email+profile+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&authuser=0&prompt=consent
348
349 // verify state
365
366 console.log('trying to get the user info: ', tokens)
367 const userInfoResponse = await fetch("https://openidconnect.googleapis.com/v1/userinfo", {
368 headers: {
369 Authorization: `Bearer ${tokens.accessToken}`

ChatGPTTextDefinitionUserscriptmain.tsx13 matches

@xsec•Updated 9 months ago
99
100 // Configuration
101 const API_CONFIG = {
102 url: "https://willthereader-openaidefiner.web.val.run",
103 method: "POST",
236 };
237
238 // API response handling
239 async function processApiResponse(response) {
240 const reader = response.body.getReader();
241
278
279 try {
280 console.time("makeApiRequest");
281 const response = await makeApiRequest(selectedText);
282 console.timeEnd("makeApiRequest");
283
284 console.time("processApiResponse");
285 await processApiResponse(response);
286 console.timeEnd("processApiResponse");
287 } catch (error) {
288 store.dispatch({ type: "ERROR", payload: error.message });
463 }
464
465 async function makeApiRequest(text) {
466 console.log(`Preparing to send fetch request for text: "${text}"`);
467 try {
468 const response = await fetch(API_CONFIG.url, {
469 ...API_CONFIG,
470 body: JSON.stringify({ selection: text }),
471 });
477 return response;
478 } catch (error) {
479 console.error("Error making API request:", error);
480 throw new Error("Failed to fetch definition from the server. Please try again.");
481 }

chatmain.tsx1 match

@xsec•Updated 9 months ago
3async function getOpenAI() {
4 // if you don't have a key, use our std library version
5 if (Deno.env.get("OPENAI_API_KEY") === undefined) {
6 const { OpenAI } = await import("https://esm.town/v/std/openai");
7 return new OpenAI();

parserSampleJSONmain.tsx1 match

@sherry007•Updated 9 months ago
21 const model = await builder();
22 const input = await prompt.format({
23 question: "What is the capital of France?",
24 });
25 const response = await model.call(input);

bedtimeStoryMakermain.tsx1 match

@daniellevine•Updated 9 months ago
32// "*",
33// unkey({
34// apiId: "rlns_2AMjVgwwMksmssLVb56LVmkpB56C",
35// }),
36// );

xxxclearinghouse_validator

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

Apiify11 file matches

@wolf•Updated 20 hours ago
Kapil01
apiv1