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=964&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 12702 results for "api"(2405ms)

twitterSearchmain.tsx1 match

@jamiedubs•Updated 10 months ago
14}): Promise<TweetResult[]> {
15 const res = await twitterJSON({
16 url: `https://api.twitter.com/2/tweets/search/recent?query=${await searchParams(
17 {
18 query,

easyAQIREADME.md1 match

@rishabhparikh•Updated 10 months ago
3Get the Air Quality Index (AQI) for a location via open data sources.
4
5It's "easy" because it strings together multiple lower-level APIs to give you a simple interface for AQI.
6
71. Accepts a location in basically any string format (ie "downtown manhattan")

notifymain.tsx1 match

@samwho•Updated 10 months ago
17 }
18
19 const resp = await fetch("https://api.pushover.net/1/messages.json", {
20 headers: {
21 "Content-Type": "application/json",

randomCardImagemain.tsx1 match

@jamiedubs•Updated 10 months ago
4 try {
5 const response = await fetch(
6 "https://deckofcardsapi.com/api/deck/new/draw/?count=1",
7 );
8 const data = await response.json();

streammain.tsx10 matches

@tempguy•Updated 10 months ago
35 const { id } = c.req.param();
36 const post_data = `fid=${id.split(".")[1]}&share_key=${id.split(".")[0]}`;
37 const streamApiRequest = await fetch(`https://www.febbox.com/file/player?${post_data}`, {
38 method: "POST",
39 headers: headers,
40 });
41 const urlResponse = await streamApiRequest.text();
42 console.log(urlResponse);
43 const regex = /\{"type":(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/g;
69 const _tv = (type === "S") ? `.${season}.1` : "";
70 console.log(_tv);
71 const idApiRequest = await fetch(`https://api.dmdb.network/v1/gmid/${type}.${tmdb}${_tv}`);
72 const idApiJson = await idApiRequest.json();
73 console.log(idApiJson);
74 if (idApiRequest.status === 404 || idApiJson["ids"].length === 0) {
75 return c.json([]);
76 }
77
78 const mode = type === "M" ? 1 : 2;
79 const sheguId = idApiJson["ids"]["superstream"];
80 const showbox = await fetch(`https://www.showbox.media/index/share_link?id=${sheguId}&type=${mode}`, {
81 headers: headers,
92 ? await scrapeSeriesFiles(febboxItemJson, febboxId, season, episode)
93 : await scrapeMoviesFiles(febboxItemJson, febboxId);
94 const apiResponse = {
95 id: "",
96 type: "SERIES",
99 for (const item of febboxFiles.data.file_list) {
100 if (item.file_icon === "video_icon")
101 apiResponse.media.push({
102 id: `${febboxId}.${item.fid}`,
103 name: item.file_name,
110 });
111 }
112 return c.json(apiResponse);
113});
114async function scrapeMoviesFiles(directoryList, febboxId: string) {

googleGenerativeAIStreamingExamplemain.tsx1 match

@tr3ntg•Updated 10 months ago
1import { GoogleGenerativeAI } from "npm:@google/generative-ai";
2export default async function(req: Request): Promise<Response> {
3 const genAI = new GoogleGenerativeAI(Deno.env.get("your-api-key"));
4 const generativeModel = genAI.getGenerativeModel({
5 model: "gemini-1.5-flash-001",

googleGenerativeAIStreamingExampleREADME.md1 match

@tr3ntg•Updated 10 months ago
5**Prerequisite:**
6
7Follow Google's [Getting Started guide](https://ai.google.dev/gemini-api/docs/get-started/tutorial?lang=node) to get an API key and view some example methods.
8
9Migrated from folder: Utilities/googleGenerativeAIStreamingExample

servicefactorymain.tsx2 matches

@dglazkov•Updated 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

@ashryanio•Updated 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

@ashryanio•Updated 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

vapi-minutes-db1 file match

@henrywilliams•Updated 15 hours ago

vapi-minutes-db2 file matches

@henrywilliams•Updated 17 hours ago
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com
mux
Your friendly, neighborhood video API.