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/$%7Bart_info.art.src%7D?q=api&page=1276&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 13978 results for "api"(1726ms)

resyVenueIdFromSlugAndCitymain.tsx3 matches

@vtdocs•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { resyPublicAPIKey } from "https://esm.town/v/vtdocs/resyPublicAPIKey";
3
4export const resyVenueIdFromSlugAndCity = async (
10}> => {
11 const venueRes = await fetch(
12 `https://api.resy.com/3/venue?url_slug=${slug}&location=${city}`,
13 {
14 "headers": {
15 "authorization":
16 `ResyAPI api_key="${resyPublicAPIKey}"`,
17 "x-resy-auth-token": resyToken,
18 "x-resy-universal-auth": resyToken,

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",

new-val-api-demo

@shouser•Updated 1 day ago
This is an example of using the API to create a val.

groq-api2 file matches

@cameronpak•Updated 1 day ago
snartapi
mux
Your friendly, neighborhood video API.