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%22Optional%20title%22?q=api&page=1379&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 15466 results for "api"(3179ms)

chatmain.tsx2 matches

@nimalu•Updated 1 year ago
1import { chatMessages } from "https://esm.town/v/nimalu/chatMessages";
2
3// https://api.val.town/express/@nimalu.chat
4export const chat = (req, res) => {
5 const messages = chatMessages
24 document.getElementById("message-input").value = '';
25 const ul = document.getElementById("inbox");
26 const data = await fetch("https://api.val.town/eval/@nimalu.sendChatMessage('" + message + "','"+ sender + "')")
27 .then(res => res.json())
28 .then(res => res.data)

myApimain.tsx1 match

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

testPostCallmain.tsx1 match

@mehmet•Updated 1 year ago
3export async function testPostCall() {
4 const result = await fetchJSON(
5 "https://api.val.town/express/@stevekrouse.postWebhook1",
6 {
7 method: "POST",

exchangeCurrencymain.tsx1 match

@mgruel•Updated 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

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

pipeSampleLLMToolmain.tsx2 matches

@ilyazub•Updated 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

@jaeseung272crb•Updated 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

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

myApimain.tsx1 match

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

myApimain.tsx1 match

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

HN-fetch-call2 file matches

@ImGqb•Updated 2 days ago
fetch HackerNews by API

token-server1 file match

@kwhinnery_openai•Updated 3 days ago
Mint tokens to use with the OpenAI Realtime API for WebRTC
Kapil01
apiv1