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=1055&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 11835 results for "api"(1061ms)

githubFileChangedmain.tsx1 match

@stevekrouse•Updated 1 year ago
4export let githubFileChanged = async (owner, repo, file) => {
5 let handle = `${owner}/${repo}/${file}`
6 let current = await fetchJSON(`https://api.github.com/repos/${owner}/${repo}/contents/${file}`)
7 let previous = githubFileCache[handle]
8 if (previous?.content && current?.content && previous?.content !== current?.content) {

mathFactmain.tsx1 match

@andrewh•Updated 1 year ago
3// Random math fact
4export let mathFact = fetchText(
5 "http://numbersapi.com/random/math"
6);
19 url,
20 username: url
21 .replace("https://api.github.com/users/", "")
22 .replace("/events", ""),
23 commitsLast7Days: commits.filter((commit) =>

holidaysUSmain.tsx1 match

@brenton•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);

kindnessmain.tsx1 match

@nate•Updated 1 year ago
4export let kindness = async () => {
5 return await gpt3({
6 openAiKey: process.env.OPENAI_API_KEY,
7 prompt:
8 "Speaking as universal consciousness, say something short, true, uplifting, loving, and kind.",

myApimain.tsx1 match

@lawliet•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}
2
3export let nameTopHNThreadUsingSomeonesVal = (async () => {
4 // Cheerio parses markup and provides an API to interact with the resulting data structure
5 const cheerio = await import("npm:cheerio"); // You can import NPM packages
6 const replyText = await fetchText(

myApimain.tsx1 match

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

clearMyApimain.tsx1 match

@acmu•Updated 1 year ago
1let { fizz } = await import("https://esm.town/v/acmu/fizz");
2
3export function clearMyApi(name) {
4 fizz = "";
5 return "clear yes nbnbnb";

myApimain.tsx1 match

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

simple-scrabble-api1 file match

@bry•Updated 2 hours ago

social_data_api_project3 file matches

@tsuchi_ya•Updated 10 hours ago
apiv1
papimark21