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=1547&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 18222 results for "api"(1404ms)

langchainExmain.tsx1 match

@weaverwhale•Updated 1 year ago
7 const model = new OpenAI({
8 temperature: 0.9,
9 openAIApiKey: process.env.openai,
10 maxTokens: 100,
11 }, {});

myApimain.tsx1 match

@jamesyin•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

pushNotemain.tsx4 matches

@dandivelbiss•Updated 1 year ago
1// Login into the Notehub API with a programmatic access client ID and client secret
2// Returns the api token to be used for subsequent requests
3const authenticate = async (): Promise<string> => {
4 const body = new URLSearchParams();
23 const token = await authenticate();
24 const res = await fetch(
25 `https://api.notefile.net/v1/projects/${projectUID}/devices/${deviceUID}/notes/${fileName}`,
26 {
27 method: "POST",
34 );
35 if (res.ok) return true;
36 throw new Error("Failed to push note to Notehub API");
37 } catch (e) {
38 console.log(e);

checkin_aliyunpanmain.tsx2 matches

@yieldray•Updated 1 year ago
72}
73
74async function getAccessTokenWithValTown(valTownAPIKey?: string): Promise<string> {
75 if (valTownAPIKey) Deno.env.set("valtown", valTownAPIKey);
76 const { blob } = await import("https://esm.town/v/std/blob");
77 const KEY = "aliyunpan-checkin";

MusicAPI2main.tsx3 matches

@nishui•Updated 1 year ago
10 }
11 console.log(id);
12 console.log(`https://music.163.com/api/v3/song/detail?id=${id}&c=[{"id":"${id}"}]`);
13
14 var uri = `https://music.163.com/api/v3/song/detail?id=${id}&c=[{"id":"${id}"}]`;
15 var encodedUri = encodeURI(uri);
16
21 [data1, data2] = await Promise.all([
22 fetch(encodedUri),
23 fetch(`https://music.163.com/api/song/media?id=${id}`),
24 ]);
25

upload_urlmain.tsx1 match

@stevekrouse•Updated 1 year ago
1// Function to upload data using Wormhole API and return the URL
2async function uploadToFileIo(file) {
3 const formData = new FormData();

modifyImageREADME.md1 match

@stevekrouse•Updated 1 year ago
1Code from https://deno.com/blog/build-image-resizing-api
2
3Useful for compressing an image before sending to chatgpt4v, for example

modifyImageREADME.md1 match

@stevekrouse•Updated 1 year ago
1Code from https://deno.com/blog/build-image-resizing-api
2
3Useful for compressing an image before sending to chatgpt4v, for example

GistGPT_Clientmain.tsx4 matches

@weaverwhale•Updated 1 year ago
16 GistGPT
17 </h1>
18 <p class="mb-4">Client for the <a class="underline" target="_blank" href="https://www.val.town/v/weaverwhale/GistGPT">GistGPT API</a></p>
19 <p class="mb-4">Provide a RAW file URL from Github, BitBucket, GitLab, Val Town, etc. and GistGPT will provide you the gist of the code.</p>
20 <input
22 placeholder="Provide a raw gist link here"
23 />
24 <p class="my-4">Have it summarize <a class="inline-block underline cursor-pointer" id="summarize-this">this file</a>, or <a class="inline-block underline cursor-pointer" id="summarize-api">the API's file</a> and it will explain how it works 🤯</p>
25 </body>
26 <script>
27 document.getElementById("summarize-api").addEventListener("click", (e) => {
28 e.target.disabled = true;
29 window.location.href = "/gist?url=https://esm.town/v/weaverwhale/GistGPT";
30 document.querySelector("input").value = "Summarizing the API\'s file...";
31 })
32

PriestGPTClientmain.tsx1 match

@mjweaver01•Updated 1 year ago
15 PriestGPT
16 </h1>
17 <p class="mb-4">Client for the <a class="underline" href="https://www.val.town/v/mjweaver01/PriestGPT">PriestGPT API</a></p>
18 <p class="mb-4">Ask him about books or verses in the bible, and he will be sure to give you a short sermon about it!</p>
19 <input

github-api1 file match

@cricks_unmixed4u•Updated 3 hours ago

beeminder-api4 file matches

@cricks_unmixed4u•Updated 3 hours ago
Kapil01
apiv1