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=1016&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 11851 results for "api"(1030ms)

dictmain.tsx1 match

@suhasUpdated 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

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

nameNationalitymain.tsx1 match

@axel_sbUpdated 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

@wiltUpdated 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

@tmcwUpdated 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

@stevekrouseUpdated 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

@scoUpdated 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_dikermanUpdated 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

@jacoblee93Updated 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

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

simple-scrabble-api1 file match

@bryUpdated 16 hours ago

social_data_api_project3 file matches

@tsuchi_yaUpdated 1 day ago
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
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com