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=441&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 4574 results for "api"(411ms)

slackBotExamplemain.tsx1 match

@maxm•Updated 1 year ago
16 // like the sender and the message text
17 const result = await fetchJSON(
18 "https://slack.com/api/chat.postMessage",
19 {
20 headers: {

telegramWebhookExamplemain.tsx1 match

@maxm•Updated 1 year ago
4 // Verify this webhook came from our bot
5 if (
6 req.headers.get("x-telegram-bot-api-secret-token")
7 !== Deno.env.get("telegramWebhookSecret")
8 ) {

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>

reloadOnSaveREADME.md1 match

@stevekrouse•Updated 1 year ago
1# Reload in new tabs when your vals change
2
3When you're working on an HTML HTTP val in a new tab, it's annoying to have to manually reload the tab on every save. In the Val Town editor, you can hit cmd+enter, but there's nothing like that for a val in a new tab because Val Town doesn't control that new tab (like we control the iframe in the browser preview). However, you control that HTML via the fetch handler you're writing, so you can add a script that polls the Val Town API for the current version number of your val, and reload itself if it detects a new version. This val has a collection of helpers to help you do just that.
4
5## Usage

vtOpenAPIREADME.md1 match

@stevekrouse•Updated 1 year ago
1null
2
3Migrated from folder: Archive/vtOpenAPI

jsonBodyParsingREADME.md1 match

@tmcw•Updated 1 year ago
1null
2
3Migrated from folder: Web_API/jsonBodyParsing

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

receiveEmailAndConvertToPDFmain.tsx4 matches

@tmcw•Updated 1 year ago
3
4/**
5 * This requires a free API token from browserless.io saved in your
6 * Env Variables as BROWSERLESS_API_KEY
7 */
8let sendPDF = async (subject, html) => {
9 const browserlessApi = Deno.env.get("BROWSERLESS_API_KEY");
10 const browser = await puppeteer.connect({
11 browserWSEndpoint: `wss://chrome.browserless.io?token=${browserlessApi}`,
12 });
13 const page = await browser.newPage();

untitled_redEarthwormmain.tsx2 matches

@tmcw•Updated 1 year ago
2
3export default async () => {
4 const browserlessApi = Deno.env.get("BROWSERLESS_API_KEY");
5 const browser = await puppeteer.connect({
6 browserWSEndpoint: `wss://chrome.browserless.io?token=${browserlessApi}`,
7 });
8 const page = await browser.newPage();

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

PassphraseAPI2 file matches

@wolf•Updated 1 day ago

openapi2 file matches

@stevekrouse•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)