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=1045&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 11798 results for "api"(1883ms)

githubUsermain.tsx1 match

@hultner•Updated 1 year ago
3// Github profile
4export let githubUser = fetchJSON(
5 "https://api.github.com/users/hultner"
6);

myApimain.tsx1 match

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

myApimain.tsx1 match

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

myApimain.tsx1 match

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

discordGetChannelsmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { discordAPI } from "https://esm.town/v/stevekrouse/discordAPI";
2
3// https://discord.com/developers/docs/resources/guild#get-guild-channels
4export let discordGetChannels = ({token, tokenType, guildId}) => discordAPI({
5 token,
6 tokenType,

unauthenticatedCantMutatemain.tsx2 matches

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

badArgs1main.tsx3 matches

@stevekrouse•Updated 1 year ago
5 console.log(
6 await fetchText(
7 "https://api.val.town/v1/run/stevekrouse.id",
8 {
9 method: "POST",
15 console.log(
16 await fetchText(
17 "https://api.val.town/v1/run/stevekrouse.id",
18 {
19 method: "POST",
27 console.log(
28 await fetchText(
29 "https://api.val.town/v1/run/stevekrouse.id",
30 {
31 method: "POST",

mathFactmain.tsx1 match

@cathy•Updated 1 year ago
3// Random math fact
4export let mathFact = fetchText(
5 "http://numbersapi.com/random/math"
6);

myApimain.tsx1 match

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

myApimain.tsx1 match

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

social_data_api_project3 file matches

@tsuchi_ya•Updated 7 hours ago

new-val-api-21 file match

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