You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$1?q=api&page=12&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 18711 results for "api"(2390ms)
10/* 1 â–¸ Crypto batch ---------------------------------------------- */
11const ids = crypto.join(",");
12const cgURL = `https://api.coingecko.com/api/v3/simple/price`
13+ `?ids=${ids}&vs_currencies=aud&include_24hr_change=true`;
14const cgRes = await fetch(cgURL, { headers: { "x-cg-demo-api-key": CG_KEY } });
15Object.assign(out, await cgRes.json());
1617/* 2 â–¸ Equity / ETF quotes --------------------------------------- */
18for (const sym of stocks) {
19const avURL = `https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=${sym}&apikey=${AV_KEY}`;
20const data = await fetch(avURL).then(r => r.json());
21const q = data["Global Quote"];
45async function getRate(from: string, to: string) {
46const url = `https://www.alphavantage.co/query?function=CURRENCY_EXCHANGE_RATE`
47+ `&from_currency=${from}&to_currency=${to}&apikey=${AV_KEY}`;
48const d = await fetch(url).then(r => r.json());
49
3import { assets, ttlMs } from "./ticker_config.tsx";
45/* map api keys → pretty labels */
6const label = (id: string) => ({
7"usd-coin": "USDC",