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/$2?q=api&page=1431&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 17539 results for "api"(5681ms)

intromain.tsx1 match

@cw12•Updated 10 months ago
1import { ComputeText, sb, Substrate } from "npm:substrate";
2
3const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") });
4
5const story = new ComputeText({ prompt: "tell me a story, be concise", max_tokens: 800 });

blobWithSqlitemain.tsx1 match

@yawnxyz•Updated 10 months ago
1// This implementation uses SQLite to store blob data instead of the Val Town API.
2// It creates a 'blobs' table to store key-value pairs, where the key is the blob key
3// and the value is the blob data stored as TEXT. This approach allows for persistence

sqliteAdminREADME.md1 match

@kamalnrf•Updated 10 months ago
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans

sqliteAdminmain.tsx2 matches

@kamalnrf•Updated 10 months ago
27 <head>
28 <title>SQLite Explorer</title>
29 <link rel="preconnect" href="https://fonts.googleapis.com" />
30
31 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32 <link
33 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34 rel="stylesheet"
35 />

gifStoryREADME.md1 match

@pa•Updated 10 months ago
5Currently it renders cached output, for demo purposes (running takes 30-60s).
6
7🪩 To fork, [sign up for Substrate](https://substrate.run/signin) to get your own API key and $50 free credits

gifStorymain.tsx2 matches

@pa•Updated 10 months ago
4import { zodToJsonSchema } from "npm:zod-to-json-schema";
5
6const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") });
7
8const topic = "a traveler lost in a rainforest";
133<body>
134 <div id="container">
135 <img id="gifDisplay" src="/api/placeholder/500/300" alt="GIF Display">
136 <div id="textOverlay"></div>
137 </div>

emailmain.tsx2 matches

@std•Updated 10 months ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { parseSendGridEmail } from "https://esm.town/v/stevekrouse/parseSendGridEmail?v=8";
3import { parseSendGridEmails } from "https://esm.town/v/stevekrouse/parseSendGridEmails?v=10";
69}) => {
70 let result = await fetch(
71 `${API_URL}/v1/email`,
72 {
73 method: "POST",

VALLEREADME.md3 matches

@oijoijcoiejoijce•Updated 10 months ago
6* Fork this val to your own profile.
7* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
8* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-variables).
9* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environment-variables).
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.
11
12<img width=500 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7077d1b5-1fa7-4a9b-4b93-f8d01d3e4f00/public"/>

shotclipmain.tsx1 match

@kortina•Updated 10 months ago
16async function getResults(q: string, n: number): Promise<ShotResult[]> {
17 const substrate = new Substrate({
18 apiKey: process.env.SUBSTRATE_API_KEY,
19 });
20 const collectionName = "shotclip";

GetWebsiteMetadatamain.tsx1 match

@dvsj•Updated 10 months ago
5 // First extract query param from the URL
6 const url = new URL(req.url);
7 // People forget capitalization all the time. Let's go easy on them and check a few queryParam keys. :)
8 const targetUrlKeys = [
9 "targetURL",

RandomQuoteAPI

@Freelzy•Updated 18 hours ago

HAPI7 file matches

@dIgitalfulus•Updated 1 day ago
Kapil01
apiv1