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=816&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 10974 results for "api"(1436ms)

RootLayoutmain.tsx2 matches

@iamseeley•Updated 11 months ago
19 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
20 <script src={tailwindURL} />
21 <link rel="preconnect" href="https://fonts.googleapis.com" />
22<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
23<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Jaro:opsz@6..72&display=swap" rel="stylesheet" />
24 <script src="https://unpkg.com/htmx.org@1.9.12" integrity="sha384-ujb1lZYygJmzgSwoxRggbCHcjc0rB2XoQrxeTUQyRjrOnlCoYta87iKBWq3EsdM2" crossorigin="anonymous"></script>
25 <style>

stockPricemain.tsx1 match

@stevekrouse•Updated 11 months ago
4async function alphaVantage(symbol: string) {
5 let data = await fetchJSON(
6 `https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=${symbol}&apikey=${Deno.env.get("alphaVantage")}`,
7 );
8 return data;

uploadImagemain.tsx1 match

@easrng•Updated 11 months ago
24}
25async function getUploadURL(): Promise<string> {
26 const data = await (await fetch("https://www.val.town/api/trpc/generateImageUploadUrl", {
27 "headers": {
28 "content-type": "application/json",

currencymain.tsx2 matches

@stevekrouse•Updated 11 months ago
6
7export let currency = async (desired, base = "usd", amount = 1) => {
8 let { rates } = await fetchJSON(`https://open.er-api.com/v6/latest/${base}`);
9 if (rates && rates[desired.toUpperCase()]) return amount * (rates[desired.toUpperCase()]);
10 else {
11 let { rates } = await fetchJSON("https://api.coingecko.com/api/v3/exchange_rates");
12 return amount * rates[desired.toLowerCase()]?.value / rates[base.toLowerCase()]?.value;
13 }

blob_adminREADME.md1 match

@samk•Updated 11 months ago
9[![](https://stevekrouse-button.express.val.run/Install)](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
12
13# TODO

lastloginREADME.md1 match

@pomdtr•Updated 11 months ago
75```
76
77See the [URLPattern API](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API) for reference.
78
79## Logout

spotifyAPImain.tsx2 matches

@HuskyChicken•Updated 11 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let spotifyAPI = ({token, endpoint, ...params}) => fetchJSON(
4 `https://api.spotify.com/v1/${endpoint}?${new URLSearchParams(params)}`,
5 {
6 headers: { Authorization: `Bearer ${token}` },

rawmain.tsx4 matches

@pomdtr•Updated 11 months ago
4
5async function createScreenshot(code: string) {
6 const apiUrl = "https://sourcecodeshots.com/api/image";
7 const resp = await fetch(apiUrl, {
8 method: "POST",
9 headers: {
39 }
40 }
41 const resp = await fetch(`https://api.val.town/v1/alias/${author}/${name}`, {
42 headers,
43 });
50 const version = url.searchParams.get("v");
51 const resp = await fetch(
52 `https://api.val.town/v1/vals/${val.id}/versions/${version}`,
53 { headers },
54 );

cors_proxyREADME.md1 match

@adrienj•Updated 11 months ago
1```
2curl 'https://taras-free_open_router.web.val.run/api/v1/chat/completions' \
3 -H 'accept: application/json' \
4 -H 'authorization: Bearer THIS_IS_OVERRIDEN_ON_SERVER' \

milligramCssmain.tsx1 match

@xkonti•Updated 11 months ago
9
10export const stylesheets = [
11 "https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic",
12 "https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css",
13 "https://cdnjs.cloudflare.com/ajax/libs/milligram/1.4.1/milligram.css",

daily-advice-app1 file match

@dcm31•Updated 2 days ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaine•Updated 3 days ago
apiv1
papimark21