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/$%7Bsuccess?q=api&page=985&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 12148 results for "api"(2174ms)

untitled_aquaQuailmain.tsx3 matches

@liflovsUpdated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { LibsqlError, type ResultSet, type TransactionMode } from "npm:@libsql/client";
3import { z } from "npm:zod";
13
14async function execute(statement: InStatement): Promise<ResultSet> {
15 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
16 method: "POST",
17 headers: {
27
28async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
29 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
30 method: "POST",
31 headers: {

gsheet_callmain.tsx2 matches

@mattxUpdated 1 year ago
6 );
7 const googleAuthOptions = {
8 scope: ["https://www.googleapis.com/auth/spreadsheets"],
9 };
10 const token = await getToken(service_account, googleAuthOptions);
11 const result = fetchJSON(
12 `https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`,
13 {
14 method,

findIdeaListsmain.tsx2 matches

@nbbaierUpdated 1 year ago
1import { api } from "https://esm.town/v/pomdtr/api";
2import { extractMetadata } from "https://esm.town/v/pomdtr/extractMetadata?v=4";
3import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
4
5export default async function() {
6 let { data: articles } = await api(`/v1/search/vals?query=${encodeURIComponent("@vtIdeas")}`);
7
8 return articles.filter(val => {

valtownIdeasREADME.md2 matches

@pomdtrUpdated 1 year ago
19
20```
21import { api } from "https://esm.town/v/pomdtr/api";
22
23export const dynamicFolder = async () => {
24 const { data: posts } = await api(`/v1/search/vals?q=${encodeURIComponent("@post")}`);
25 return {
26 folder: "Blog",

untitled_oliveLoonREADME.md1 match

@sernaUpdated 1 year ago
9To use it on your own Val Town SQLite database, [fork it](https://www.val.town/v/stevekrouse/sqlite_admin/fork) to your account.
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).

untitled_lavenderMiteREADME.md1 match

@hlobilUpdated 1 year ago
9To use it on your own Val Town SQLite database, [fork it](https://www.val.town/v/stevekrouse/sqlite_admin/fork) to your account.
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).

vtWishListmain.tsx2 matches

@nbbaierUpdated 1 year ago
1// @title My Val Town Wish List
2
3import { api } from "https://esm.town/v/pomdtr/api";
4import { extractMetadata } from "https://esm.town/v/pomdtr/extractMetadata";
5import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
9export async function examplePost(req: Request) {
10 const { author, name } = extractValInfo(import.meta.url);
11 const { code, readme } = await api(`/v1/alias/${author}/${name}`);
12 const title = extractMetadata("title", code);
13 return html(await gfm(readme, { title, favicon: "🎁" }));

vtWishListREADME.md1 match

@nbbaierUpdated 1 year ago
3Some things I'd love to see come to val town (some of these are already on the way according to the team)
4
5- [x] Editing a val's readme through the API
6- [x] A command bar (something like [paco's cmdk](https://cmdk.paco.me/) would be *dope*)
7- [ ] The ability or programmatically respond to events (like a val being run) right within Val Town

vtIdeaListREADME.md3 matches

@nbbaierUpdated 1 year ago
5- [ ] A bare bones CMS to edit markdown files hosted on a github (or val town readmes eventually)
6- [ ] A set of Vals for interacting with github repos via Octokit (useful for the above CMS idea)
7- [ ] A full json-server like implementation for quickly generating stub APIs based on json/valtown blob data ([begun](https://www.val.town/v/nbbaier/dbToAPI))
8- [ ] An implementation of [Convert bookmarklet to Chrome extension](https://sandbox.self.li/bookmarklet-to-extension/)
9- [ ] A tool for generating an NPM package from a Val or set of Vals (something like [dnt]- [ ] (https://github.com/denoland/dnt/))
11- [ ] A component library (this would be a wild swing for me)
12- [ ] A val to get a dependency graph of a val(s) ([started here](https://www.val.town/v/rlesser/dependency_graph) by [rlesser](https://www.val.town/u/rlesser))
13- [ ] A single val that wraps a [FeTS client](https://the-guild.dev/openapi/fets) to the API for saving a couple of lines of boilerplate
14- [ ] A val for generating OpenAPI specs from jsdoc comments within vals (sort of like [this npm package](https://www.npmjs.com/package/jsdoc-openapi))
15- [ ] Conways game of life
16

basicAuthREADME.md1 match

@pomdtrUpdated 1 year ago
17```
18
19If you want to use an apiToken as a password:
20
21```ts

groq-vapi-demo1 file match

@yawnxyzUpdated 3 hours ago

social_data_api_project3 file matches

@tsuchi_yaUpdated 1 day ago
snartapi
papimark21