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=951&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 12013 results for "api"(1467ms)

aliasmain.tsx2 matches

@easrng•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
2
3export async function alias<P extends Params>(params: P): Promise<Result<P>> {
4 const username = params.username;
5 let url = `${API_URL}/v1/alias/${username}`;
6 if ("valName" in params)
7 url = url + `/${params.valName}`;

htmlExampleREADME.md2 matches

@willthereader•Updated 1 year ago
1# Returning HTML from the Val Town Web API
2
3This just lets you use the standard [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) object with our [Web API](https://docs.val.town/api/web) to return an HTML response from this Val.

leaderboardmain.tsx1 match

@pomdtr•Updated 1 year ago
10 const table = stripAnsi(renderTable(zip(res)));
11
12 const resp = await fetch("https://sourcecodeshots.com/api/image", {
13 method: "POST",
14 headers: {

sqliteBlobmain.tsx2 matches

@postpostscript•Updated 1 year ago
1import { Statement, type StatementInstance } from "https://esm.town/v/postpostscript/sqliteBuilder";
2import { createSqlite } from "https://esm.town/v/postpostscript/sqliteWasm";
3import { blob as blobAPI } from "https://esm.town/v/std/blob";
4
5export async function sqliteBlob(options: SqliteBlobOptions = {}) {
11
12export async function sqliteBlobSchema(
13 { prefix = undefined, table = Statement`blobs`, blob = blobAPI }: SqliteBlobOptions = {},
14) {
15 const blobs = await blob.list(prefix);

sqliteUniversemain.tsx3 matches

@postpostscript•Updated 1 year ago
4import { Statement, StatementInstance } from "https://esm.town/v/postpostscript/sqliteBuilder";
5import { sqliteDump } from "https://esm.town/v/postpostscript/sqliteDump";
6import { sqliteFromAPI } from "https://esm.town/v/postpostscript/sqliteFromAPI";
7import type { SqliteInterface } from "https://esm.town/v/postpostscript/sqliteTypes";
8import { createSqlite } from "https://esm.town/v/postpostscript/sqliteWasm";
141 /^https:\/\//,
142 ({ endpoint }) => {
143 return sqliteFromAPI(endpoint);
144 },
145 ] as SqlitePatternTup,
147 /^@/,
148 ({ endpoint }) => {
149 return sqliteFromAPI(endpoint);
150 },
151 ] as SqlitePatternTup,

extractImportsmain.tsx1 match

@pomdtr•Updated 1 year ago
1import { api } from "https://esm.town/v/pomdtr/api";
2import ts from "npm:typescript";
3

manifold_daily_loan_collectormain.tsx2 matches

@jackc•Updated 1 year ago
1export default async function() {
2 const res = await fetch("https://api.manifold.markets/request-loan", {
3 headers: {
4 Authorization: `Key ${Deno.env.get("manifoldApiKey")}`,
5 },
6 });

manifold_daily_loan_collectorREADME.md2 matches

@jackc•Updated 1 year ago
3Instructions:
41. Fork this Val.
52. Get your Manifold API key [from your profile](https://manifold.markets/profile).
63. Add `manifoldApiKey` with your key to the [Val Environment Variables](https://www.val.town/settings/environment-variables).
74. Hit run! It will run daily to collect your loans.

valtownToSQLitemain.tsx1 match

@postpostscript•Updated 1 year ago
60export async function valtownToSQLite(options: { sqlite: SqliteInterface } = { sqlite }) {
61 await options.sqlite.execute(createQuery);
62 let url = "https://api.val.town/v1/search/vals?query=%20&limit=100";
63 while (true) {
64 const resp = await fetch(url);

createmain.tsx1 match

@websandbox•Updated 1 year ago
1export async function create({ code, token }: { code: string; token: string }) {
2 const { error, details, url } = await (await fetch("https://websandbox-createAPI.web.val.run", {
3 body: JSON.stringify({ code, token }),
4 method: "POST",

social_data_api_project3 file matches

@tsuchi_ya•Updated 3 hours ago

simple-scrabble-api1 file match

@bry•Updated 3 days ago
apiv1
papimark21