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/image-url.jpg%20%22Image%20title%22?q=api&page=1386&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 17621 results for "api"(4016ms)

ablePinkDogREADME.md1 match

@nicosql•Updated 8 months ago
19```
20
21If you want to use an [api token](https://www.val.town/settings/api) to authenticate:
22
23```ts

harshAquamarineRoostermain.tsx4 matches

@nicosql•Updated 8 months ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { LibsqlError, type ResultSet, type Row, type TransactionMode } from "npm:@libsql/client";
3import { z } from "npm:zod";
35
36async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
50
51async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
52 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
53 method: "POST",
54 headers: {
78
79/* Val Town's Turso Proxy returns rows as an array of values
80 * Yet the LibSQL API has a Row type which behave as an array or object,
81 * ie you can access it via numerical index or string
82 */

renewedAmethystRattlesnakeREADME.md1 match

@pperi•Updated 8 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

compactAmberMongooseREADME.md1 match

@pperi•Updated 8 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

blob_adminREADME.md1 match

@pperi•Updated 8 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

convertEmailToBlogDraftmain.tsx2 matches

@georgemandis•Updated 8 months ago
13- Create a new Markdown file in a specified GitHub repository.
14
15 We'll use the email handler from Val Town, html-to-markdown for conversion, and the GitHub API via Octokit to create the file.
16 */
17
50 content: btoa(binString),
51 headers: {
52 "X-GitHub-Api-Version": "2022-11-28",
53 },
54 });

convertEmailToBlogDraftREADME.md1 match

@georgemandis•Updated 8 months ago
6- This script assumes you're using some kind of static site generator that can read from a GitHub repository. There are many to choose from in this space. I'm partial to [11ty](http://11ty.dev)
7- Gmail is doing some heavy-lifting for me here in terms of kindly converting my HTML email to Markdown behind the scenes. It's not a guarantee all email providers do this. If yours does not, you may have to investigate an HTML-to-Markdown conversion step.
8- We'll use the GitHub API via Octokit to create the file. You'll need to [create a token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#) and store it an an environmental variable in your Val Town settings.
9
10

arenaApiExamplemain.tsx2 matches

@deblina•Updated 8 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let arenaApiExample = (async () => {
4 const resp = await fetch(
5 "http://api.are.na/v2/channels/project-logs",
6 );
7 const json = await resp.json();

arenaApiExampleREADME.md3 matches

@deblina•Updated 8 months ago
1# Are.na API
2
3Example of using the [are.na](https://dev.are.na/documentation/channels#Block43472) API to get the contents of an Are.na board - specifically my fun board that showcases websites with that "glossy black style."
4
5All you need is [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to make this happen!

bbrunmain.tsx1 match

@kenbarrett•Updated 8 months ago
131
132const boardToEndpoint = (board: string) => {
133 return board.replace(/\.json$/, ".api/run");
134};
135

RandomQuoteAPI

@Freelzy•Updated 22 hours ago

HAPI7 file matches

@dIgitalfulus•Updated 1 day ago
Kapil01
apiv1