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=1546&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 17956 results for "api"(2742ms)

whiteXerinaemain.tsx2 matches

@stevekrouse•Updated 1 year ago
23 <head>
24 <title>SQLite Explorer</title>
25 <link rel="preconnect" href="https://fonts.googleapis.com" />
26 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
27 <link
28 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
29 rel="stylesheet"
30 />

whiteXerinaeREADME.md1 match

@stevekrouse•Updated 1 year ago
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans

whiteThrushmain.tsx2 matches

@stevekrouse•Updated 1 year ago
22 <head>
23 <title>SQLite Explorer</title>
24 <link rel="preconnect" href="https://fonts.googleapis.com" />
25 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
26 <link
27 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
28 rel="stylesheet"
29 />

whiteThrushREADME.md1 match

@stevekrouse•Updated 1 year ago
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans

password_authmain.tsx3 matches

@stevekrouse•Updated 1 year ago
61
62async function fetchUser(token: string): Promise<{ id: string }> {
63 const resp = await fetch("https://api.val.town/v1/me", {
64 headers: {
65 Authorization: `Bearer ${token}`,
74}
75
76async function verifyApiToken(token: string) {
77 try {
78 const [currentUser, requestUser] = await Promise.all([fetchUser(Deno.env.get("valtown")), fetchUser(token)]);
146 const formData = await req.formData();
147 const password = formData.get("password") as string;
148 if (!passwords.includes(password) && !(await verifyApiToken(password))) {
149 return new Response("Unauthorized", {
150 status: 403,

password_authREADME.md2 matches

@stevekrouse•Updated 1 year ago
11## Usage
12
13If you want to use an [api token](https://www.val.town/settings/api) to authenticate:
14
15```ts
41```
42
43Note that authenticating using your api token is always an option.
44
45## TODO

password_authREADME.md1 match

@pomdtr•Updated 1 year ago
15```
16
17If you want to use an [api token](https://www.val.town/settings/api) to authenticate:
18
19```ts

oldstyleUtilmain.tsx3 matches

@easrng•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
2export function getMainExport(
3 mod: any,
35export async function set(path: string, value: any) {
36 let resolveResp = await fetch(
37 `${API_URL}/v1/alias/${path}`,
38 {
39 headers: {
48 const { id } = await resolveResp.json();
49 let resp = await fetch(
50 `${API_URL}/v1/vals/${id}/versions`,
51 {
52 method: "POST",

valshotmain.tsx2 matches

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

jsr2ghmain.tsx1 match

@vladimyr•Updated 1 year ago
30
31export async function fetchPackageData(scope: string, name: string) {
32 const prefixUrl = "https://api.jsr.io/";
33 const data = await ky.get(`scopes/${scope}/packages/${name}`, { prefixUrl }).json();
34 return v.parse(PackageDataSchema, data);

dailyQuoteAPI

@Souky•Updated 1 day ago

HTTP

@Ncharity•Updated 1 day ago
Daily Quote API
Kapil01
apiv1