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=838&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 10974 results for "api"(1854ms)

fetch_docsmain.tsx3 matches

@andreterron•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2
3/**
7 * @param {string | URL | Request} input - The resource to fetch.
8 * @param {RequestInit} [requestInit] - Optional configuration data (HTTP
9 * method, headers, etc) ([Docs ↗](https://deno.land/api@v1.42.1?s=RequestInit))
10 */
11export async function fetch(input: string | URL | Request, requestInit?: RequestInit) {
12 const origReq = new Request(input, requestInit);
13 const url = new URL("/v1/fetch", API_URL);
14 url.searchParams.set("url", origReq.url);
15 const req = new Request(url, origReq);

fetchmain.tsx3 matches

@vladimyr•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2
3/**
7 * @param {string | URL | Request} input - The resource to fetch.
8 * @param {RequestInit} [requestInit] - Optional configuration data (HTTP
9 * method, headers, etc) ([Docs ↗](https://deno.land/api@v1.42.1?s=RequestInit))
10 */
11export async function fetch(input: string | URL | Request, requestInit?: RequestInit) {
12 const origReq = new Request(input, requestInit);
13 const url = new URL("/v1/fetch", API_URL);
14 url.searchParams.set("url", origReq.url);
15 const req = new Request(url, origReq);

sqlitemain.tsx3 matches

@std•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { LibsqlError, type TransactionMode } from "npm:@libsql/client";
3import { z } from "npm:zod";
35
36async function execute(statement: InStatement): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
49
50async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
51 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
52 method: "POST",
53 headers: {

fetchmain.tsx3 matches

@std•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { rawFetch } from "https://esm.town/v/std/rawFetch";
3
8 * @param {string | URL} input - The URL to fetch
9 * @param {RequestInit} [requestInit] - Optional configuration data (HTTP
10 * method, headers, etc) ([Docs ↗](https://deno.land/api@v1.42.1?s=RequestInit))
11 */
12export async function fetch(input: string | URL, requestInit?: RequestInit) {
14 url: input.toString(),
15 });
16 return rawFetch(`${API_URL}/v1/fetch?${query}`, {
17 ...requestInit,
18 headers: {

email_docsmain.tsx2 matches

@andreterron•Updated 1 year 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";
62}) => {
63 let result = await fetch(
64 `${API_URL}/v1/email`,
65 {
66 method: "POST",

sqlite_docsmain.tsx3 matches

@andreterron•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { LibsqlError, type TransactionMode } from "npm:@libsql/client";
3import { z } from "npm:zod";
35
36async function execute(statement: InStatement): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
49
50async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
51 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
52 method: "POST",
53 headers: {

blob_docsmain.tsx5 matches

@andreterron•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { ValTownBlobError } from "https://esm.town/v/std/ValTownBlobError";
3import { ValTownBlobNotFoundError } from "https://esm.town/v/std/ValTownBlobNotFoundError";
82async function list(prefix?: string): Promise<{ key: string; size: number; lastModified: string }[]> {
83 let querystring = prefix ? `?prefix=${encodeURIComponent(prefix)}` : "";
84 const res = await fetch(`${API_URL}/v1/blob${querystring}`, {
85 headers: {
86 Authorization: `Bearer ${Deno.env.get("valtown")}`,
95
96async function delete_(key: string) {
97 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
98 method: "DELETE",
99 headers: {
108
109async function get(key: string) {
110 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
111 headers: {
112 Authorization: `Bearer ${Deno.env.get("valtown")}`,
124
125async function set(key: string, value: BodyInit) {
126 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
127 method: "POST",
128 headers: {

awesomeREADME.md2 matches

@pomdtr•Updated 1 year ago
40- @pomdtr/test_explorer
41
42### Api
43
44- @pomdtr/api
45- @pomdtr/trpc
46

sqlite_adminREADME.md1 match

@robsimmons•Updated 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).

valshotmain.tsx2 matches

@burningion•Updated 1 year ago
22
23export async function createScreenshot(code: string, theme: string = "dark-plus"): Promise<URL> {
24 const apiUrl = "https://sourcecodeshots.com/api/image/permalink";
25 const { url } = await ky.post(apiUrl, {
26 json: {
27 code,

daily-advice-app1 file match

@dcm31•Updated 2 days ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaine•Updated 3 days ago
apiv1
papimark21