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%20%22Image%20title%22?q=api&page=962&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 13540 results for "api"(1162ms)

falDemoAppmain.tsx2 matches

@daisukeUpdated 6 months ago
15 try {
16 const fal = createFalClient({
17 proxyUrl: "/api/fal/proxy",
18 });
19
139 }
140
141 if (url.pathname === "/api/fal/proxy") {
142 return falProxyRequest(req);
143 }

geminiBboxmain.tsx15 matches

@yawnxyzUpdated 6 months ago
6 *
7 * Key features:
8 * - Integrates with Google's Generative AI API
9 * - Processes user-uploaded images for object detection
10 * - Visualizes detected objects with bounding boxes
11 * - Allows customization of detection parameters (grid, contrast)
12 * - Stores API key securely in browser's local storage
13 *
14 * The app is built using Hono.js and can be deployed on Val Town or run locally with Deno.
29<p>This application visualizes object detection results by drawing bounding boxes on images using the <a href="https://ai.google.dev/">Google's Gemini 1.5 Pro AI model</a>.</p>
30
31<p>API keys are only stored in your browser's local storage.</p>
32<p>Images are only sent to Google's Gemini API servers for processing.</p>
33
34<p>Try the following images (click the links to add them):</p>
174 window.handleImageUrlClick = handleImageUrlClick;
175
176 // Retrieves the API key from local storage or prompts the user to enter it
177 function getApiKey() {
178 let apiKey = localStorage.getItem("GEMINI_API_KEY");
179 if (!apiKey) {
180 apiKey = prompt("Please enter your Gemini API key:");
181 if (apiKey) {
182 localStorage.setItem("GEMINI_API_KEY", apiKey);
183 }
184 }
185 return apiKey;
186 }
187
188 // Initializes and returns a Google Generative AI model instance
189 async function getGenerativeModel(params) {
190 const API_KEY = getApiKey();
191 const genAI = new GoogleGenerativeAI(API_KEY);
192 return genAI.getGenerativeModel(params);
193 }
915 <div class="mt-2">
916 <p>Use this to detect bounding boxes of objects in an image. Use the image description to help with setting up the prompt. Rows and columns determine how many tiles the image will be divided into — for simple images, 1x1 is best.</p>
917 <p>For the free API you might get the "Resource has been exhausted" error if you make too many requests too quickly.</p>
918 <textarea id="promptInput" rows=6>Identify and return bounding boxes of the (MAIN SUBJECT) \n[ymin, xmin, ymax, xmax]</textarea>
919 <div class="checkbox-container my-2">

fullWebsiteVersionmain.tsx1 match

@willthereaderUpdated 6 months ago
73
74 const lsdResponse = await fetch(
75 `https://lsd.so/api?query=${encodeURIComponent(query)}`,
76 );
77

BBslackScoutREADME.md4 matches

@alexdphanUpdated 6 months ago
7## Getting Started
8To run Slack Scout, you’ll need a
9- Browserbase API key
10- Slack Webhook URL: setup [here](https://docs.val.town/integrations/slack/send-messages-to-slack/)
11- Twitter Developer API key
12
13### Browserbase
19### Twitter
20
21We’ve decided to use the Twitter API to include Twitter post results. It costs $100 / month to have a Basic Twitter Developer account. _If you decide to use Browserbase, we can lend our token. Comment below for access._
22
23Once you have the `SLACK_WEBHOOK_URL`, `BROWSERBASE_API_KEY`, and `TWITTER_BEARER_TOKEN`, input all of these as [Val Town Environment Variables](https://www.val.town/settings/environment-variables).
24
25---

BBslackScoutmain.tsx3 matches

@alexdphanUpdated 6 months ago
54 query: topic,
55 pages: 2,
56 apiKey: Deno.env.get("BROWSERBASE_API_KEY") ?? "",
57 });
58}
63 maxResults: 10,
64 daysBack: 1,
65 apiKey: Deno.env.get("TWITTER_BEARER_TOKEN") ?? "",
66 });
67}
98
99 if (!response.ok) {
100 throw new Error(`Slack API error: ${response.status} ${response.statusText}`);
101 }
102

falProxyRequestmain.tsx1 match

@stevekrouseUpdated 6 months ago
4 const headers = new Headers(req.headers);
5 headers.set("x-proxy-authorization", `Bearer ${Deno.env.get("valtown")}`);
6 return fetch("https://fal-faltownproxy.web.val.run/api/faltown/proxy", {
7 method,
8 headers,

testplaywrightmain.tsx5 matches

@fgeierstUpdated 6 months ago
5console.info("Launching browser...");
6
7// Use Deno.env to get the API key
8const apiKey = Deno.env.get("BROWSERBASE_API_KEY");
9if (!apiKey) {
10 console.error("BROWSERBASE_API_KEY environment variable is not set");
11 Deno.exit(1);
12}
14try {
15 const browser = await chromium.connectOverCDP(
16 `wss://connect.browserbase.com?apiKey=${apiKey}`,
17 );
18 console.info("Connected!");

discordActivityClientmain.tsx5 matches

@neverstewUpdated 6 months ago
51 // /.proxy/ is prepended here in compliance with CSP
52 // see https://discord.com/developers/docs/activities/development-guides#construct-a-full-url
53 const response = await fetch("/.proxy/api/token", {
54 method: "POST",
55 headers: {
104
105/**
106 * This function utilizes RPC and HTTP apis, in order show the current guild's avatar
107 * Here are the steps:
108 * 1. From RPC fetch the currently selected voice channel, which contains the voice channel's guild id
109 * 2. From the HTTP API fetch a list of all of the user's guilds
110 * 3. Find the current guild's info, including its "icon"
111 * 4. Append to the UI an img tag with the related information
117 }
118
119 // 1. From the HTTP API fetch a list of all of the user's guilds
120 const guilds = await fetch(
121 "https://discord.com/api/users/@me/guilds",
122 {
123 headers: {

arcGISHonoMiddlewaremain.tsx1 match

@wiltUpdated 6 months ago
108
109/**
110 * Converts parameters to the proper representation to send to the ArcGIS REST API.
111 * @param params The object whose keys will be encoded.
112 * @return A new object with properly encoded values.

arcGISHonoMiddlewareREADME.md1 match

@wiltUpdated 6 months ago
1Copy of [ArcGISIdentityManager.authorize()](https://github.com/Esri/arcgis-rest-js/blob/bfd7ce977d9879077e92fabfc491240d8f230844/packages/arcgis-rest-request/src/ArcGISIdentityManager.ts#L760), OAuth2 authentication for the ESRI ArcGIS API which is implemented as Express middleware, ported to Hono.
2
3Migrated from folder: gisc/arcGISHonoMiddleware

create-val-api-demo1 file match

@shouserUpdated 3 hours ago

new-val-api-demo

@shouserUpdated 3 hours ago
This is an example of using the API to create a val.
papimark21
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