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?q=api&page=1445&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 18306 results for "api"(3245ms)

fetchValInfoREADME.md1 match

@pomdtr•Updated 7 months ago
11## What's the difference with `extractValInfo` ?
12
13@pomdtr/extractValInfo get metadata synchronously by analysing the val import url, while @pomdtr/fetchValInfo perform an http call to the val.town REST api.
14
15Only use `fetchValInfo` if you need some metadata that are not available from `extractValInfo`.

getMyValIdREADME.md2 matches

@stevekrouse•Updated 7 months ago
14
15Works even if the val is private if you provide
16a Val Town API token for the account that
17owns the private val in question.
18
19Below the Val Town SDK is implicitly authenticated,
20because it pulls user's Val Town API token from their
21default `'valtown'` environment variable.
22

handsomeMagentaStoatREADME.md3 matches

@wangqiao1234•Updated 7 months ago
1# OpenAI - [Docs ↗](https://docs.val.town/std/openai)
2
3Use OpenAI's chat completion API with [`std/openai`](https://www.val.town/v/std/openai). This integration enables access to OpenAI's language models without needing to acquire API keys.
4
5For free Val Town users, [all calls are sent to `gpt-4o-mini`](https://www.val.town/v/std/openaiproxy?v=12#L85).
65If these limits are too low, let us know! You can also get around the limitation by using your own keys:
66
671. Create your own API key on [OpenAI's website](https://platform.openai.com/api-keys)
682. Create an [environment variable](https://www.val.town/settings/environment-variables?adding=true) named `OPENAI_API_KEY`
693. Use the `OpenAI` client from `npm:openai`:
70

handsomeMagentaStoatmain.tsx7 matches

@wangqiao1234•Updated 7 months ago
2
3/**
4 * API Client for interfacing with the OpenAI API. Uses Val Town credentials.
5 */
6export class OpenAI {
8
9 /**
10 * API Client for interfacing with the OpenAI API. Uses Val Town credentials.
11 *
12 * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
14 * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
15 * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
16 * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
17 * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
18 * @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers.
19 */
20 constructor(options: Omit<ClientOptions, "baseURL" | "apiKey" | "organization"> = {}) {
21 this.rawOpenAIClient = new RawOpenAI({
22 ...options,
23 baseURL: "https://std-openaiproxy.web.val.run/v1",
24 apiKey: Deno.env.get("valtown"),
25 organization: null,
26 });

blob_adminREADME.md1 match

@ohad•Updated 7 months ago
9[![](https://stevekrouse-button.web.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

primewiremain.tsx2 matches

@temptemp•Updated 7 months ago
3import { getLinks } from "https://esm.town/v/tempdev/blue";
4import {
5 primewireApiKey,
6 primewireBase,
7} from "https://raw.githubusercontent.com/Ciarands/mw-providers/dev/src/providers/sources/primewire/common.ts";
8
9async function search(imdbId: string) {
10 const searchResult = await fetch(`${primewireBase}/api/v1/show?key=${primewireApiKey}&imdb_id=${imdbId}`);
11 return await searchResult.json().then((searchResult) => {
12 return searchResult.id;

aimain.tsx12 matches

@yawnxyz•Updated 7 months ago
26
27const anthropic = createAnthropic({
28 // apiKey = Deno.env.get("ANTHROPIC_API_KEY");
29 apiKey: Deno.env.get("ANTHROPIC_API_KEY_COVERSHEET")
30});
31
32const openai = createOpenAI({
33 // apiKey = Deno.env.get("OPENAI_API_KEY");
34 apiKey: Deno.env.get("OPENAI_API_KEY_COVERSHEET")
35});
36
37
38const groq = createOpenAI({
39 baseURL: 'https://api.groq.com/openai/v1',
40 apiKey: Deno.env.get("GROQ_API_KEY"),
41});
42
43const perplexity = createOpenAI({
44 apiKey: Deno.env.get("PERPLEXITY_API_KEY") ?? '',
45 baseURL: 'https://api.perplexity.ai/',
46});
47
48const googleProvider = createGoogleGenerativeAI({
49 apiKey: Deno.env.get("GOOGLE_GENERATIVE_AI_API_KEY"),
50});
51
214 if (toolResults && toolResults.length > 0) {
215 // we have to do this bc the AI SDK doesn't seem to let you carry over function calling results,
216 // so we pretend to be the user instead of using the official role: tool API, which breaks everything
217 for (const toolResult of toolResults) {
218 options.messages.push({
512 return c.json(response);
513 } catch (error) {
514 console.error('API error:', error);
515 return c.text('Error occurred.', 500);
516 }
542 return c.json(response);
543 } catch (error) {
544 console.error('API error:', error);
545 return c.text('Error occurred.', 500);
546 }

blob_adminREADME.md1 match

@flymaster•Updated 7 months ago
9[![](https://stevekrouse-button.web.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

btcPricemain.tsx2 matches

@panphora•Updated 7 months ago
8
9 let btc = await fetchJSON(
10 `https://rest.coinapi.io/v1/quotes/COINBASE_SPOT_BTC_USD/current`,
11 {
12 headers: {
13 "X-CoinAPI-Key": Deno.env.get("COIN_API"),
14 },
15 },

distancemain.tsx5 matches

@panphora•Updated 8 months ago
4 const destinationB = encodeURIComponent(String(searchParams.get("b")).trim());
5
6 const apiKey = Deno.env.get("GOOGLE_MAPS_API_KEY");
7 if (!apiKey) {
8 return new Response("Google Maps API key is not set", { status: 500 });
9 }
10
11 const response = await fetch(
12 `https://maps.googleapis.com/maps/api/distancematrix/json?destinations=${destinationA}&origins=${destinationB}&units=imperial&key=${apiKey}`,
13 );
14
15 if (!response.ok) {
16 return new Response("Failed to fetch data from Google Maps API", { status: response.status });
17 }
18

Galacta1 file match

@defunkt•Updated 12 mins ago
Marvel Rivals GPT via tracker.gg API

github-api1 file match

@cricks_unmixed4u•Updated 23 hours ago
snartapi
apiry