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=980&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"(1277ms)

renderGithubReadmemain.tsx2 matches

@pomdtr•Updated 1 year ago
6 repo: string;
7 };
8 const markdown = await fetch(`https://api.github.com/repos/${repo}/readme`)
9 .then((res) => res.json()).then(({ content }) => atob(content));
10 const html = await fetch("https://api.github.com/markdown", {
11 method: "POST",
12 headers: {

myApimain.tsx1 match

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

viewMailboxmain.tsx2 matches

@nimalu•Updated 1 year ago
1import { mailbox } from "https://esm.town/v/nimalu/mailbox";
2
3// https://api.val.town/express/@nimalu.viewMailbox
4export const viewMailbox = (req, res) => {
5 const messages = mailbox
24 li.innerHTML = '<span class="font-semibold text-gray-900">Web</span>: ' + message;
25 ul.appendChild(li)
26 fetch("https://api.val.town/eval/@nimalu.messageMe('" + message + "','Web')")
27 }
28

myApimain.tsx1 match

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

myApimain.tsx1 match

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

EmailNotifIfDidntCodemain.tsx1 match

@Davidkim•Updated 1 year ago
15 }
16 const githubEvents = await fetchJSON(
17 "https://api.github.com/users/daviddkkim/events",
18 ) as Data;
19 //early return if no github events

holidaysUSmain.tsx1 match

@testhandle•Updated 1 year ago
3// Public holidays in the US in 2023
4export let holidaysUS = fetchJSON(
5 "https://date.nager.at/api/v2/publicholidays/2023/US"
6);

myApimain.tsx1 match

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

githubFollowersmain.tsx1 match

@stungeye•Updated 1 year ago
3export async function githubFollowers() {
4 let followers = await fetchJSON(
5 "https://api.github.com/users/stungeye/followers",
6 );
7 return followers;

homemain.tsx1 match

@rym•Updated 1 year ago
2import { blocks as blocks2 } from "https://esm.town/v/rym/blocks";
3
4// Access via https://api.val.town/v1/express/rym.home
5export async function home(req: express.Request, res: express.Response) {
6 const blocks = await blocks2();

social_data_api_project3 file matches

@tsuchi_ya•Updated 4 hours ago

new-val-api-21 file match

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