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=408&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 4144 results for "api"(586ms)

emailREADME.md1 match

@shouser•Updated 8 months ago
54You can attach files to your emails by using the `attachments` field.
55Attachments need to be [Base64](https://en.wikipedia.org/wiki/Base64) encoded,
56which is that the [btoa](https://developer.mozilla.org/en-US/docs/Web/API/btoa)
57method is doing in this example:
58

emailmain.tsx2 matches

@shouser•Updated 8 months ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { parseSendGridEmail } from "https://esm.town/v/stevekrouse/parseSendGridEmail?v=8";
3import { parseSendGridEmails } from "https://esm.town/v/stevekrouse/parseSendGridEmails?v=10";
69}) => {
70 let result = await fetch(
71 `${API_URL}/v1/email`,
72 {
73 method: "POST",

cronLoggermain.tsx2 matches

@nbbaier•Updated 9 months ago
1import { inTheBackground } from "https://esm.town/v/neverstew/inTheBackground";
2import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
3import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
4import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=45";
26 headers["Authorization"] = `Bearer ${token}`;
27 }
28 const { id } = await fetchJSON(`${API_URL}/v1/alias/${userHandle}/${valName}`, { headers });
29
30 const table_name = "cron_evals";

demoSDKREADME.md4 matches

@stevekrouse•Updated 10 months ago
1# Val Town REST API TypeScript SDK Demos
2
3This val demonstrates basic usage of the the Val Town JS/TS SDK.
5You can fork this val to your account to quickly try it out.
6
7Authentication is automatically set by the `VAL_TOWN_API_KEY` environment
8variable, which is automatically set within Val Town. You can control the
9API scopes of that key in your val's settings page.
10
11* [Learn more](https://docs.val.town/sdk/)
12* [Reference docs](https://github.com/val-town/sdk/blob/main/api.md)
13
14Migrated from folder: Archive/demoSDK

valToGHmain.tsx2 matches

@nbbaier•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=42";
3import { Octokit } from "npm:@octokit/rest";
127
128 try {
129 const { code } = await fetchJSON(`${API_URL}/v1/alias/${vtUser}/${valName}`, {
130 headers: { "Authorization": `Bearer ${Deno.env.get("valtown")}` },
131 });

readabilityHTTPProxymain.tsx2 matches

@nbbaier•Updated 1 year ago
25 <meta charset="UTF-8" />
26 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
27 <link rel="preconnect" href="https://fonts.googleapis.com">
28<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
29<link href="https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap" rel="stylesheet">
30 <title>${title}</title>
31 <style>

submitPRREADME.md2 matches

@nbbaier•Updated 1 year ago
1# Submit a PR from Val Town
2
3This val provides a (very) thin wrapper around the GH rest API methods for creating a pull request. It handles the creation of a Octokit client for you.
4
5## Usage
20## Parameters
21
22The function takes two parameters: your gh access token and an object that's identical to the object submitted to the gh API. See [GH's documentation](https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#create-a-pull-request) for more info!
23
24

dbToAPImain.tsx2 matches

@nbbaier•Updated 1 year ago
1/** @jsxImportSource https://esm.sh/hono@3.9.2/jsx **/
2
3import { Homepage } from "https://esm.town/v/nbbaier/dbToAPIFrontend";
4import { checkResource, getResources, type Options, validate } from "https://esm.town/v/nbbaier/dbToApiHelpers";
5import { Hono } from "npm:hono";
6

updateValByIDmain.tsx1 match

@nbbaier•Updated 1 year ago
20 };
21
22 return fetchJSON(`https://api.val.town/v1/vals/${valId}`, {
23 headers: {
24 Authorization: `Bearer ${token}`,

updateValByNamemain.tsx1 match

@nbbaier•Updated 1 year ago
14 };
15
16 return fetchJSON("https://api.val.town/v1/vals", {
17 headers: {
18 Authorization: `Bearer ${token}`,

openapi2 file matches

@stevekrouse•Updated 2 days ago

dbToAPI_backup4 file matches

@nbbaier•Updated 4 days ago
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com
fiberplane
Purveyors of Hono tooling, API Playground enthusiasts, and creators of 🪿 HONC 🪿 (https://honc.dev)