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=856&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"(928ms)

homelessmain.tsx3 matches

@cameronpak•Updated 11 months ago
16 "protocol": "https", // For Typesense Cloud use https
17 }],
18 "apiKey": Deno.env.get("TYPESENSE_API_KEY") || "",
19 "connectionTimeoutSeconds": 10,
20 "retryIntervalSeconds": 0.1,
136 "q": query,
137 "query_by": queryBy || "*",
138 "per_page": 250, // The max number of resources to return is 250 — https://typesense.org/docs/0.25.1/api/search.html#ranking-and-sorting-parameters
139 "filter_by": filterBy || filterByRadius,
140 "sort_by": `location(${lat}, ${lng}):asc`,
215);
216
217app.get("/", (c) => c.text("Welcome to the Homeless Services API"));
218app.get("/resources", async (c) => {
219 console.log(c.req.header);

valwritermain.tsx1 match

@stevekrouse•Updated 11 months ago
106 console.log(result.rows[0]);
107
108 // Blob storage API
109 import { blob } from "https://esm.town/v/std/blob";
110 const key = "blob_test";

blob_adminREADME.md1 match

@iamseeley•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

createValmain.tsx1 match

@stevekrouse•Updated 11 months ago
30
31export function createVal({ token, ...data }: { token?: string } & CreateValArgs): Promise<ValResponse> {
32 return fetchJSON("https://api.val.town/v1/vals", {
33 bearer: token || Deno.env.get("valtown"),
34 method: "PUT",

lastFmNowPlayingmain.tsx1 match

@fossforlife•Updated 11 months ago
1import LastFm from "npm:lastfm-node-client";
2
3const lastFm = new LastFm(Deno.env.get("LASTFM_API_KEY"));
4const data = await lastFm.userGetRecentTracks({
5 user: "elias-jackson2",

frontmattermain.tsx2 matches

@pomdtr•Updated 11 months ago
1import { api } from "https://esm.town/v/pomdtr/api";
2import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
3import { parse } from "jsr:@std/yaml";
24
25export async function extractValFrontmatter(val: { author: string; name: string }) {
26 const { readme } = await api<{ readme: string }>(`/v1/alias/${val.author}/${val.name}`);
27 return extractFrontmatter(readme);
28}

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 }

mod-interview-api1 file match

@twschiller•Updated 2 hours ago

daily-advice-app1 file match

@dcm31•Updated 3 days ago
Random advice app using Advice Slip API
apiv1
papimark21