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/?q=api&page=992&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 11381 results for "api"(871ms)

lichessDashboardmain.tsx1 match

@jdanUpdated 1 year ago
9 "Bullet",
10 "Computer",
11 "Rapid",
12 "Top Rated",
13 "Blitz",

OpenAISummarymain.tsx5 matches

@zzzUpdated 1 year ago
6// Create a summary from a given text using GPT 4
7export const OpenAISummary = async (text: string, config: {
8 apiKey?: string;
9 jwt?: string;
10 modelName?: string;
11} = {}) => {
12 const { apiKey, jwt, modelName = "gpt-4" } = config;
13 if (!apiKey && !jwt) {
14 const { success, reset } = await upstashRateLimiter(
15 "anon",
22 }
23 }
24 else if (!apiKey) {
25 try {
26 await verifyJWT(jwt);
31 }
32 const agent = await AIAgent(
33 apiKey || process.env.OPENAI_API_KEY_GPT4,
34 );
35 const response = await agent.summarize(text, modelName);

getModelBuildermain.tsx5 matches

@webupUpdated 1 year ago
10 const { LangChainTracer } = await import("npm:langchain/callbacks");
11 const client = new Client({
12 apiUrl: "https://api.smith.langchain.com",
13 apiKey: process.env.LANGSMITH,
14 });
15 const tracer = new LangChainTracer({ client });
16 const callbacks = options?.verbose !== false ? [tracer] : [];
17 // Set up API key for each providers
18 const args = extend({ callbacks }, options);
19 if (spec?.provider === "openai")
20 args.openAIApiKey = process.env.OPENAI;
21 else if (spec?.provider === "huggingface")
22 args.apiKey = process.env.HUGGINGFACE;
23 // Populate model builders
24 const setup = cond([

spellCheckmain.tsx2 matches

@steveb1313Updated 1 year ago
2
3export async function spellCheck(req: express.Request, res: express.Response) {
4 let response = await fetch("https://www.dnd5eapi.co/api/spells");
5 let data = await response.json();
6 let countOfSpells = data["count"];
8 let randomSpell = data["results"][randomSpellNumber];
9 let response2 = await fetch(
10 `https://www.dnd5eapi.co/api/spells/${randomSpell["index"]}`,
11 );
12 let data2 = await response2.json();

tellmain.tsx1 match

@dverginUpdated 1 year ago
1export let tell = (msg) => return `I heard you say ${msg}`;
2//Can call w/URL with: https://api.val.town/eval/@dvergin.tell('Howdy')

myApimain.tsx1 match

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

myApimain.tsx1 match

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

openAQLocationmain.tsx1 match

@tmcwUpdated 1 year ago
13 // Test
14 const { results } = fetchJSON(
15 "https://api.openaq.org/v2/locations?" +
16 new URLSearchParams({
17 // This is a comment

hnSearchmain.tsx2 matches

@stevekrouseUpdated 1 year ago
3
4/* Search Hacker News via Agolia
5Look for the valid params: https://hn.algolia.com/api */
6export let hnSearch = async ({
7 search_by_date,
17 let cleaned_params = await searchParams(params);
18 let data = await fetchJSON(
19 `http://hn.algolia.com/api/v1/${type}?${cleaned_params}`
20 );
21 if (!data.hits && data.message) {

discordChannelmain.tsx1 match

@stevekrouseUpdated 1 year ago
3export function discordChannel({ botToken, serverId }) {
4 return fetchJSON(
5 `https://discord.com/api/guilds/${serverId}/channels`,
6 {
7 headers: {

mod-interview-api1 file match

@twschillerUpdated 1 hour ago

daily-advice-app1 file match

@dcm31Updated 3 days ago
Random advice app using Advice Slip API
papimark21
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