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/?q=api&page=1663&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 17973 results for "api"(2584ms)

getGithubStarsmain.tsx2 matches

@vtdocs•Updated 1 year ago
3export const getGithubStars = async (username: string) => {
4 const user = await fetchJSON(
5 `https://api.github.com/users/${username}`,
6 );
7 let totalStars = 0;
11 for (
12 const repo of await fetchJSON(
13 `https://api.github.com/users/${username}/repos?per_page=100&page=${
14 pages + 1
15 }`,

polygonPriceOnDatemain.tsx2 matches

@rwev•Updated 1 year ago
1import { polygonDailyAPI } from "https://esm.town/v/rwev/polygonDailyAPI";
2
3export async function polygonPriceOnDate(ticker, isoDate) {
4 const response = await polygonDailyAPI(ticker, isoDate);
5 if (response.status != "OK")
6 throw new Error(

myApimain.tsx1 match

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

mathFactmain.tsx1 match

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

myApimain.tsx1 match

@SlugeR•Updated 1 year ago
1export function myApi(count) {
2 return count + " dragons!";
3}

myApimain.tsx1 match

@lionad•Updated 1 year ago
1export function myApi(name) {
2 console.email("hi " + name);
3}

starWarsmain.tsx2 matches

@hepuffin•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Explore the Star Wars universe, from StarWarsAPI
4export let starWars = fetchJSON(
5 "https://swapi.dev/api/people/1/"
6);

myApimain.tsx1 match

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

textmain.tsx1 match

@andrewn•Updated 1 year ago
3export const text = (async () => {
4 let mathFact = await fetchText(
5 "http://numbersapi.com/random/math",
6 );
7 return { data: `${mathFact} ${mathFact} ${mathFact}` };

myApimain.tsx1 match

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

dailyQuoteAPI

@Souky•Updated 1 day ago

HTTP

@Ncharity•Updated 1 day ago
Daily Quote API
Kapil01
apiv1