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/image-url.jpg?q=api&page=1044&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 11852 results for "api"(1049ms)

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}`,

pixelmain.tsx1 match

@stevekrouse•Updated 1 year ago
31 }
32 else if (req.path.startsWith("/track")) {
33 // TODO lookup ip location http://ip-api.com/json/172.85.34.113
34 let data = {
35 query: req.query,

valOutputmain.tsx1 match

@stevekrouse•Updated 1 year ago
11 const name = match[2];
12 const val = await fetchJSON(
13 `https://api.val.town/v1/alias/${author}/${name}`,
14 );
15 return new Response(val.output.value);

planesAboveMemain.tsx1 match

@stevekrouse•Updated 1 year ago
15 });
16 console.log({ lat, lon, display_name });
17 let url = `https://opensky-network.org/api/states/all?${query}`;
18 let data = await fetchJSON(url);
19 return data?.states?.map((f) => ({

aqiLocationmain.tsx1 match

@stevekrouse•Updated 1 year ago
5export let aqiLocation = async ({ lat, lon }: { lat: number; lon: number }) => {
6 const { results } = fetchJSON(
7 "https://api.openaq.org/v2/locations?" +
8 new URLSearchParams({
9 limit: "10",

apiTestmain.tsx1 match

@maxdrake•Updated 1 year ago
1export let apiTest = (input) => {
2 return input + ", hi";
3};

chatGPTExamplemain.tsx2 matches

@maxdrake•Updated 1 year ago
1import { chatGPT } from "https://esm.town/v/maxdrake/chatGPT";
2
3export let chatGPTExample = async (API_KEY) => {
4 let repsonse_obj = await chatGPT(
5 "hello assistant",
6 [], // this can be an empty list, or if you're using this to continue a conversation, you can pass in someting of the form: https://platform.openai.com/docs/guides/chat/introduction
7 API_KEY
8 );
9 let response_text = repsonse_obj.message;

myApimain.tsx1 match

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

myApimain.tsx1 match

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

myApimain.tsx1 match

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

social_data_api_project3 file matches

@tsuchi_ya•Updated 1 hour ago

simple-scrabble-api1 file match

@bry•Updated 18 hours ago
apiv1
papimark21