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/$%7Burl%7D?q=api&page=1297&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 14188 results for "api"(2040ms)

myApimain.tsx1 match

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

weatherTestmain.tsx1 match

@ktm•Updated 1 year ago
3export async function weatherTest(lat, long) {
4 return "hi";
5 const URL = `https://api.weather.gov/points/${lat},${long}`;
6 return URL;
7 const res = await fetch(URL);

callPrivateAPImain.tsx3 matches

@galligan•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let callPrivateAPI = async ({ handle, val, method = "GET", secret }) => {
4 let endpoint;
5 if (handle && val) {
9 endpoint = "galligan.simpleTest";
10 }
11 const valTownUrl = "https://api.val.town/v1/run/" + endpoint;
12 // Make an authenticated request to Val Town API
13 const response = await fetchJSON(valTownUrl, {
14 method,

deleteValmain.tsx1 match

@neverstew•Updated 1 year ago
5 id: string;
6}): Promise<Response> {
7 return fetch("https://api.val.town/v1/vals/" + id, {
8 headers: {
9 Authorization: `Bearer ${token}`,

myApimain.tsx1 match

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

myApimain.tsx1 match

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

myApimain.tsx1 match

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

measureValTownE2emain.tsx2 matches

@healeycodes•Updated 1 year ago
8 for (let i = 0; i < count; i++) {
9 let start = Date.now();
10 await fetch("https://api.val.town/eval/(()=%3E1+1)()");
11 evalTimes.push(Date.now() - start);
12 }
23 for (let i = 0; i < count; i++) {
24 let start = Date.now();
25 await fetch("https://api.val.town/eval/@healeycodes.addOnes()");
26 userFuncTimes.push(Date.now() - start);
27 }

forceUnsubmain.tsx1 match

@mihir•Updated 1 year ago
9
10 return fetchJSON(
11 "https://gmail.googleapis.com/gmail/v1/users/me/settings/filters",
12 {
13 method: "POST",

myApimain.tsx1 match

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

book-lookup5 file matches

@nucky•Updated 1 day ago
use google book api to look up bibliographic metadata elements

new-val-api-demo

@shouser•Updated 2 days ago
This is an example of using the API to create a val.
snartapi
mux
Your friendly, neighborhood video API.