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/$%7Bsuccess?q=api&page=1132&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 13013 results for "api"(1701ms)

dictmain.tsx1 match

@suhas•Updated 1 year ago
3export let dict = async (word: string) => {
4 const req = await fetch(
5 `https://api.dictionaryapi.dev/api/v2/entries/en/${word}`
6 );
7 const res = await req.json();

myApimain.tsx1 match

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

nameNationalitymain.tsx1 match

@axel_sb•Updated 1 year ago
3// Predict the nationality of a name
4export let nameNationality = fetchJSON(
5 "https://api.nationalize.io/?name=axel",
6);

thisUrlmain.tsx1 match

@wilt•Updated 1 year ago
13 return `https://${userHandle}-${valName}.web.val.run`;
14 case "run":
15 return `https://api.val.town/v1/run/${userHandle}.${valName}`;
16 case "express":
17 return `https://${userHandle}-${valName}.express.val.run`;

activitypubmain.tsx1 match

@tmcw•Updated 1 year ago
48 preferredUsername: `bot`,
49 summary: `Photos from ${DOMAIN}.com`,
50 inbox: `https://${DOMAIN}/api/inbox`,
51 followers: `https://${DOMAIN}/u/bot/followers`,
52 icon: {

discordGetMessagesmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { discordAPI } from "https://esm.town/v/stevekrouse/discordAPI";
2
3// https://discord.com/developers/docs/resources/channel#get-channel-messages
4export let discordGetMessages = ({token, tokenType, channelId}) => discordAPI({
5 token,
6 tokenType,

denoImportExmain.tsx2 matches

@sco•Updated 1 year ago
4 // );
5 // const { BskyAgent, AtpSessionEvent, AtpSessionData } = await import(
6 // "npm:atproto/api"
7 // );
8 // const _ = await import("npm:lodash-es"); // The Lodash library exported as ES modules.
9 const { BskyAgent } = await import("npm:@atproto/api");
10 // return _.shuffle(_.zip([1, 2, 3, 4], [5, 6, 7, 8]));
11 const agent = new BskyAgent({

gpt3main.tsx5 matches

@yuval_dikerman•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let gpt3 = async (prompt: string, openAiApiKey: string): Promise<string> => {
4 if (!prompt || !openAiApiKey) {
5 let cat = await fetch("https://catfact.ninja/fact");
6 let { fact } = await cat.json();
7 return Promise.reject(
8 `Prompt text or api key was not provided. \n \n here's a cat fact: \n ${fact}`,
9 );
10 }
11 const content = await fetch("https://api.openai.com/v1/chat/completions", {
12 method: "POST",
13 body: JSON.stringify({
17 }),
18 headers: {
19 "Authorization": `Bearer ${openAiApiKey}`,
20 "Content-Type": "application/json",
21 },

streamingTestmain.tsx1 match

@jacoblee93•Updated 1 year ago
8 maxTokens: 25,
9 streaming: true,
10 openAIApiKey: process.env.OPENAI_API_KEY,
11 });
12 const response = await chat.call("Tell me a joke.", undefined, [

myApimain.tsx1 match

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

vapi-minutes-db1 file match

@henrywilliams•Updated 2 days ago

vapi-minutes-db2 file matches

@henrywilliams•Updated 2 days ago
snartapi
mux
Your friendly, neighborhood video API.