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/$%7Bsuccess?q=api&page=1454&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 16807 results for "api"(1352ms)

memoryApiExampleREADME.md1 match

@stevekrouse•Updated 1 year ago
1Migrated from folder: Archive/memoryApiExample

memoryApiExamplemain.tsx7 matches

@stevekrouse•Updated 1 year ago
1import { handleMemoryApiRequest } from "https://esm.town/v/xkonti/gptMemoryManager";
2
3const apiName = "Memory API";
4const contactEmail = "some@email.com";
5const lastPolicyUpdate = "2023-11-28";
6const blobKeyPrefix = "gpt:memories:";
7const apiKeyPrefix = "GPTMEMORYAPI_KEY_";
8
9export const memoryApiExample = async (req: Request) => {
10 return await handleMemoryApiRequest(
11 req,
12 apiName,
13 contactEmail,
14 lastPolicyUpdate,
15 blobKeyPrefix,
16 apiKeyPrefix,
17 );
18};

tgWebhookHandlermain.tsx1 match

@tarasyarema•Updated 1 year ago
33 // Verify this webhook came from our bot
34 if (
35 req.headers.get("x-telegram-bot-api-secret-token")
36 !== process.env.telegramWebhookSecret
37 ) {

fetchPinatsPostsmain.tsx2 matches

@stevedylandev•Updated 1 year ago
5 try {
6 const soRes = await fetch(
7 `https://api.stackexchange.com/2.3/questions?fromdate=${startDate}&todate=${endDate}&order=desc&sort=creation&tagged=pinata&site=stackoverflow`,
8 {
9 method: "GET",
24
25 const seRes = await fetch(
26 `https://api.stackexchange.com/2.3/questions?fromdate=${startDate}&todate=${endDate}&order=desc&sort=creation&tagged=pinata&site=ethereum`,
27 {
28 method: "GET",

crux_addmain.tsx2 matches

@yieldray•Updated 1 year ago
1export async function crux_add(name: string, content: string) {
2 const res = await fetch("https://crux.land/api/add", {
3 method: "POST",
4 headers: { "content-type": "application/json" },
14 const json = await res.json();
15 if (json.error) throw new Error(json.error);
16 return `https://crux.land/api/get/${json.id}`;
17}

checkIosBingAppsmain.tsx1 match

@cescyang_service•Updated 1 year ago
6 const { default: axios } = await import("npm:axios");
7 const url =
8 "https://sapphire.api.microsoftapp.net/config/api/v1/get?setmkt=en-us&setplatform=android&setchannel=production&settenant=sapphire-bing";
9 try {
10 const response = await fetch(url, {

checkAndroidBingAppsmain.tsx1 match

@cescyang_service•Updated 1 year ago
6 const { default: axios } = await import("npm:axios");
7 const url =
8 "https://sapphire.api.microsoftapp.net/config/api/v1/get?setmkt=en-us&setplatform=android&setchannel=production&settenant=sapphire-bing";
9 try {
10 const response = await fetch(url, {

untitled_emeraldChinchillamain.tsx1 match

@tejchak•Updated 1 year ago
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();

getReplicatePredictionmain.tsx6 matches

@patrickjm•Updated 1 year ago
7export async function getReplicatePrediction({
8 /** https://replicate.com/account */
9 apiKey,
10 predictionId,
11}: {
12 apiKey: string;
13 predictionId: string;
14}) {
15 if (!apiKey) {
16 throw new Error("missing apiKey; visit https://replicate.com/account");
17 } else if (!predictionId) {
18 throw new Error("missing predictionId");
19 }
20 const result = await fetchJSON(
21 `https://api.replicate.com/v1/predictions/${encodeURIComponent(predictionId)}`,
22 {
23 headers: {
24 Authorization: `Token ${apiKey}`,
25 },
26 },

untitled_silverFowlmain.tsx1 match

@rmahshie50•Updated 1 year ago
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();

Schedule

@Ozy•Updated 3 hours ago
Schedule_api

googleGeminiAPI2 file matches

@michaelwschultz•Updated 20 hours ago
Kapil01
apiv1