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=1035&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 11770 results for "api"(1349ms)

testApimain.tsx5 matches

@andreterron•Updated 1 year ago
1import { paginateAPI } from "https://esm.town/v/andreterron/paginateAPI";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3import process from "node:process";
4
5export const testApi = (async () => {
6
7 const threshold = 90;
13 };
14 const me = await fetchJSON(
15 "https://api.val.town/v1/me",
16 opts,
17 );
18 // TODO: Paginate
19 const vals = await paginateAPI(
20 `https://api.val.town/v1/users/${me.id}/vals?limit=100`,
21 opts,
22 );

myApimain.tsx1 match

@timur•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@alby•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@tannerwj•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@evilpaper•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

githubReposmain.tsx1 match

@jshawl•Updated 1 year ago
3// GitHub repos
4export let githubRepos = fetchJSON(
5 "https://api.github.com/users/stevekrouse/repos"
6);

myApimain.tsx1 match

@dereko•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

blocksmain.tsx2 matches

@tmcw•Updated 1 year ago
23 }
24 }"
25 x-init="blocks = await (await fetch('https://storage.googleapis.com/bb-search-data/parsed/blocks-min.json')).json()"
26 >
27 <div class='grid gap-4 grid-cols-4 lg:grid-cols-8'>
51 </html>`);
52 }
53 const gistRes = await fetch(`https://api.github.com/gists/${id}`);
54 if (!gistRes.ok) {
55 return res.send("GitHub replied with a non-200 status.");

exampleAuthApimain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { set } from "https://esm.town/v/std/set?v=11";
2import { verfiedCalls } from "https://esm.town/v/stevekrouse/verfiedCalls";
3import { verifyAPIAuth } from "https://esm.town/v/stevekrouse/verifyAPIAuth";
4
5export async function exampleAuthApi(arg1, arg2, auth) {
6 let { handle } = await verifyAPIAuth(auth);
7 if (handle) {
8 verfiedCalls.push({ handle, t: Date.now() });

authenticatedCanMutatemain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { testMutateSemantics } from "https://esm.town/v/stevekrouse/testMutateSemantics";
2
3export const authenticatedCanMutate = (api) =>
4 testMutateSemantics({
5 stateName: "@stevekrouse.testState",
6 api,
7 mutateExpected: true,
8 mutator: (now) => `export let @stevekrouse.testState = ${now}`,

social_data_api_project1 file match

@tsuchi_ya•Updated 42 mins ago

new-val-api-21 file match

@shouser•Updated 7 hours ago
This is an example of using the API to create a val.
apiv1
papimark21