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=844&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 11489 results for "api"(2968ms)

servicefactorymain.tsx2 matches

@dglazkovUpdated 10 months ago
62 * Indicates that the input or output port represents base structured
63 * datatype containing multi-part content of a message, generated by an LLM.
64 * See [Content](https://ai.google.dev/api/rest/v1beta/Content) for details
65 * on the datatype.
66 */
242 if (!inputs.$key || inputs.$key != Deno.env.get("BB_SERVICE_KEY")) {
243 return Response.json({
244 $error: "Must provide an API key to access the service.",
245 });
246 }

openAiProxymain.tsx1 match

@ashryanioUpdated 10 months ago
10export default async function(req: Request): Promise<Response> {
11 // Handle POST request
12 // This is the primary path for the API
13 if (req.method === "POST") {
14 const { prompt } = await req.json();

openAiProxyREADME.md2 matches

@ashryanioUpdated 10 months ago
3## Overview
4
5This val is a proxy server that interacts with the OpenAI API to generate responses based on prompts in the request body. The function handles incoming HTTP POST requests, processes the prompt, and returns a response generated by the LLM.
6
7## Prerequisites
8
9- Server-side: (Optional) An active OpenAI API key
10- Client-side: Something that can make POST requests (browser code, Postman, cURL, another Val, etc)
11

discordBotmain.tsx1 match

@dglazkovUpdated 10 months ago
96 const data = await response;
97 const update = await fetch(
98 `https://discord.com/api/v10/webhooks/${body.application_id}/${body.token}/messages/@original`,
99 {
100 method: "PATCH",

serve_readmemain.tsx2 matches

@cookaUpdated 10 months ago
1import { api } from "https://esm.town/v/pomdtr/api";
2import { gfm } from "https://esm.town/v/pomdtr/gfm";
3import { callerRef } from "https://esm.town/v/pomdtr/refs";
11 title = `@${val.author}/${val.name}`;
12 }
13 const { readme = "" } = await api(`/v1/alias/${val.author}/${val.name}`);
14 return readme;
15}

blackLobstermain.tsx3 matches

@bosonUpdated 10 months ago
15
16// Takoma Park, MD weather forecast
17// https://weather-gov.github.io/api/gridpoints
18const NOAA_URL_TKPK = "https://api.weather.gov/gridpoints/LWX/97,75/forecast/hourly";
19
20interface Period {
52}
53
54// Sleep a random amount of seconds (to respect NOAA's API).
55async function sleepRand(seconds: number) {
56 const s = Math.random() * seconds * 1000;

smallwebDashboardmain.tsx1 match

@pomdtrUpdated 10 months ago
47 <div class="flex flex-col items-center bg-white bg-opacity-80 p-4 rounded-lg shadow-lg transform hover:scale-105 transition-transform duration-200">
48 <img
49 src={`https://api.dicebear.com/9.x/identicon/svg?seed=${app}`}
50 alt={app}
51 class="w-24 h-24 object-cover rounded-lg mb-2"

cronLoggermain.tsx2 matches

@nbbaierUpdated 10 months ago
1import { inTheBackground } from "https://esm.town/v/neverstew/inTheBackground";
2import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
3import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
4import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=45";
26 headers["Authorization"] = `Bearer ${token}`;
27 }
28 const { id } = await fetchJSON(`${API_URL}/v1/alias/${userHandle}/${valName}`, { headers });
29
30 const table_name = "cron_evals";

weather_forecast_in_the_morningmain.tsx2 matches

@benroboUpdated 10 months ago
79const fetchForecast = async () => {
80 const response = await fetch(
81 `https://api.openweathermap.org/data/2.5/forecast?lat=${latitude}&lon=${longitude}&units=metric&appid=${openWeatherMapAppId}`,
82 );
83 const data = await response.json();
103const sendTextWithTelegram = async (text: string) => {
104 const telegramSendUrl =
105 `https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage?chat_id=${TELEGRAM_CHAT_ID}&parse_mode=HTML&disable_notification=true&text=${text}`;
106 await fetch(telegramSendUrl);
107};

private_fal_modelmain.tsx1 match

@turbo1912Updated 10 months ago
7 const result = await fal.subscribe("turbo1912/multiple-models/esrgan", {
8 input: {
9 image_url: "https://storage.googleapis.com/falserverless/gallery/NOCA_Mick-Thompson.resized.resized.jpg",
10 },
11 logs: true,

gptApiTemplate2 file matches

@charmaineUpdated 4 hours ago

mod-interview-api1 file match

@twschillerUpdated 20 hours ago
socialdata
Affordable & reliable alternative to Twitter API: ➡️ Access user profiles, tweets, followers & timeline data in real-time ➡️ Monitor profiles with nearly instant alerts for new tweets, follows & profile updates ➡️ Simple integration
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com