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/$%7Bart_info.art.src%7D?q=api&page=911&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 12867 results for "api"(2831ms)

renderPoemWidgetJsonmain.tsx2 matches

@crsvenUpdated 7 months ago
13 timeZone,
14 };
15 const timeForApi = date.toLocaleTimeString("en-GB", {
16 ...baseTimeParams,
17 hourCycle: "h23",
18 });
19 const poem = await getPoemForTime(timeForApi);
20 const newState = { ...poemWidgetJson };
21 newState.layouts.hello_small.layers[0].rows[0].cells[0].text.string = poem;

stockAPIREADME.md2 matches

@peteUpdated 7 months ago
1This Val accepts a stock symbol and will return current price and intraday price change.
2
3example: `https://pete-stockapi.web.val.run/symbol=MSFT`
4
5It's currently using alphavantage free tier API so it's limited to only 25 requests/day. Fork and create your own premium API key for more request.

placeholderKittenImagesmain.tsx1 match

@ashryanioUpdated 7 months ago
1// This val creates a publicly accessible kitten image generator using the Val Town image generation API.
2// It supports generating square images with a single dimension parameter or rectangular images with two dimension parameters.
3

FanFicScrapermain.tsx19 matches

@willthereaderUpdated 7 months ago
11 e.preventDefault();
12 setLoading(true);
13 console.log(`Submitting URL for scraping: ${url}`);
14 try {
15 const response = await fetch("/scrape", {
22 setResult(data);
23 } catch (error) {
24 console.log(`Error occurred while scraping URL: ${url}. Error details: ${error.message}`);
25 setResult({ error: error.message });
26 }
40 />
41 <button type="submit" disabled={loading}>
42 {loading ? "Scraping..." : "Scrape"}
43 </button>
44 </form>
79async function scrapePage(url) {
80 console.log(`Starting to scrape page: ${url}`);
81 const apiKey = Deno.env.get("ScrapingBeeAPIkey");
82 if (!apiKey) {
83 console.log("ScrapingBee API key not found in environment variables");
84 throw new Error("ScrapingBee API key not found in environment variables");
85 }
86
104 };
105
106 console.log(`Sending request to ScrapingBee for URL: ${url} at ${new Date().toISOString()}`);
107 const startTime = Date.now();
108 try {
109 const response = await fetch(
110 `https://app.scrapingbee.com/api/v1/?api_key=${apiKey}&url=${
111 encodeURIComponent(url)
112 }&render_js=false&extract_rules=${encodeURIComponent(JSON.stringify(extractRules))}`,
114
115 const duration = Date.now() - startTime;
116 console.log(`Received response from ScrapingBee at ${new Date().toISOString()}. Duration: ${duration}ms`);
117 console.log(`Received response from ScrapingBee for URL: ${url}. Status: ${response.status}`);
118
119 if (!response.ok) {
120 console.log(`Error response from ScrapingBee. Status: ${response.status}`);
121 throw new Error(`HTTP error! status: ${response.status}`);
122 }
156 return result;
157 } catch (error) {
158 console.log(`Error occurred while scraping URL: ${url}`);
159 console.log(`Error details: ${error.message}`);
160 console.log(`Error stack: ${error.stack}`);
163}
164
165async function getApiKey() {
166 const apiKey = Deno.env.get("ScrapingBeeAPIkey");
167 if (!apiKey) {
168 console.log("ScrapingBee API key not found in environment variables");
169 throw new Error("ScrapingBee API key not found in environment variables");
170 }
171 return apiKey;
172}
173

getBlobAndRenderAsImageREADME.md4 matches

@ashryanioUpdated 7 months ago
8
9To easily upload an image to your blob storage, [fork this val](
10getBlobAndRenderAsImage), run it, and enter your API key in the password input.
11
12## How it works
21
22 - The server function calls `blob.get("test.png")`.
23 - This `blob.get()` method makes an HTTP request to the Val Town API.
24 - The API returns a Response object containing the image data.
25
26
64
65- [Blob storage overview in Val Town docs](https://docs.val.town/std/blob/)
66- [Val Town REST API references for blobs](https://docs.val.town/openapi#tag/blobs)
67- [Val Town blob std lib source code](https://www.val.town/v/std/blob)

blob_adminREADME.md1 match

@ashryanioUpdated 7 months ago
9[![](https://stevekrouse-button.express.val.run/Install)](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
12
13# TODO

zygomorphicPurpleStoatREADME.md1 match

@seanodotcomUpdated 7 months ago
8
91. Click `Fork`
102. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
113. Click `Run`
12

redditSearchmain.tsx5 matches

@nicosqlUpdated 7 months ago
11interface RedditSearchOptions {
12 query: string;
13 apiKey?: string;
14}
15
17export async function redditSearch({
18 query,
19 apiKey = Deno.env.get("BROWSERBASE_API_KEY"),
20}: RedditSearchOptions): Promise<ThreadResult[]> {
21 if (!apiKey) {
22 throw new Error("BrowserBase API key is required");
23 }
24
25 const puppeteer = new PuppeteerDeno({ productName: "chrome" });
26 const browser = await puppeteer.connect({
27 browserWSEndpoint: `wss://connect.browserbase.com?apiKey=${apiKey}&enableProxy=true`,
28 ignoreHTTPSErrors: true,
29 });

ablePinkDogREADME.md1 match

@nicosqlUpdated 7 months ago
19```
20
21If you want to use an [api token](https://www.val.town/settings/api) to authenticate:
22
23```ts

harshAquamarineRoostermain.tsx4 matches

@nicosqlUpdated 7 months ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { LibsqlError, type ResultSet, type Row, type TransactionMode } from "npm:@libsql/client";
3import { z } from "npm:zod";
35
36async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
50
51async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
52 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
53 method: "POST",
54 headers: {
78
79/* Val Town's Turso Proxy returns rows as an array of values
80 * Yet the LibSQL API has a Row type which behave as an array or object,
81 * ie you can access it via numerical index or string
82 */

vapi-minutes-db1 file match

@henrywilliamsUpdated 1 day ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 1 day ago
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