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/$%7Bart_info.art.src%7D?q=api&page=1000&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 11656 results for "api"(3051ms)

exchangeCurrencymain.tsx1 match

@mgruelUpdated 1 year ago
1import { getExchangeRates } from "https://esm.town/v/mgruel/getExchangeRates";
2
3/** Calls https://www.exchangerate-api.com to retrieve the currency exchange rates
4 * for the provided base currency or "eur" if undefined
5 * @param {string} desired - The desired currency convert to

pageApimain.tsx1 match

@mgruelUpdated 1 year ago
9 };
10};
11export const pageApi = async <T extends any = any>(
12 url: string,
13 { offset = 0, limit = 25 }: {

pipeSampleLLMToolmain.tsx2 matches

@ilyazubUpdated 1 year ago
3
4export const pipeSampleLLMTool = (async () => {
5 const { SerpAPI } = await import("npm:langchain/tools");
6 const { PromptTemplate } = await import("npm:langchain/prompts");
7 const { StringOutputParser } = await import(
8 "npm:langchain/schema/output_parser"
9 );
10 const search = new SerpAPI(process.env.SERPAPI_KEY);
11 const prompt = PromptTemplate.fromTemplate(
12 `Turn the following user input into a search query for a search engine:

holidaysUSmain.tsx1 match

@jaeseung272crbUpdated 1 year ago
3// Public holidays in the US in 2023
4export let holidaysUS = fetchJSON(
5 "https://date.nager.at/api/v2/publicholidays/2023/US"
6);

myApimain.tsx1 match

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

myApimain.tsx1 match

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

myApimain.tsx1 match

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

starWarsmain.tsx2 matches

@insanity54Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Explore the Star Wars universe, from StarWarsAPI
4export let starWars = fetchJSON(
5 "https://swapi.dev/api/people/1/"
6);

register_discord_commandsmain.tsx1 match

@mattxUpdated 1 year ago
7 commands: Array<Object>
8) => {
9 let url = `https://discord.com/api/v10/applications/${app_id}/`;
10 if (guild_id) {
11 url += `guilds/${guild_id}/commands`;

myRunsFailedmain.tsx1 match

@andreterronUpdated 1 year ago
11 token: process.env.vt_token,
12 error: true,
13 source: ["api", "interval"],
14 since: interval.lastRunAt,
15 });

new-val-api-21 file match

@shouserUpdated 18 hours ago
This is an example of using the API to create a val.

gptApiTemplate2 file matches

@charmaineUpdated 2 days ago
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