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/$2?q=api&page=1434&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 17843 results for "api"(3632ms)

craigslistScrapermain.tsx1 match

@rochambeau314•Updated 9 months ago
1// This approach will use the fetch API to get the Craigslist page content,
2// parse it using cheerio, extract the required information,
3// and render it in a table format. We'll use React for the client-side rendering.

emailREADME.md1 match

@aroyan•Updated 9 months ago
54You can attach files to your emails by using the `attachments` field.
55Attachments need to be [Base64](https://en.wikipedia.org/wiki/Base64) encoded,
56which is that the [btoa](https://developer.mozilla.org/en-US/docs/Web/API/btoa)
57method is doing in this example:
58

emailmain.tsx2 matches

@aroyan•Updated 9 months ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { parseSendGridEmail } from "https://esm.town/v/stevekrouse/parseSendGridEmail?v=8";
3import { parseSendGridEmails } from "https://esm.town/v/stevekrouse/parseSendGridEmails?v=10";
69}) => {
70 let result = await fetch(
71 `${API_URL}/v1/email`,
72 {
73 method: "POST",

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 }

dailyQuoteAPI

@Souky•Updated 21 hours ago

HTTP

@Ncharity•Updated 23 hours ago
Daily Quote API
snartapi
apiry