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=887&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 10941 results for "api"(1086ms)

googleClientmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export const googleClient = async () => {
2 const { google } = await import("npm:googleapis");
3 const key = { client_id: "test", client_secret: "test" };
4 const client = new google.auth.OAuth2(key.client_id, key.client_secret, [

spotifySearchmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { spotifyAPI } from "https://esm.town/v/stevekrouse/spotifyAPI";
2
3export let spotifySearch = ({...params}) => spotifyAPI({
4 endpoint: 'search',
5 ...params

getMuniStopInfomain.tsx1 match

@cathy•Updated 1 year ago
5export const getMuniStopInfo = (stopCode) => {
6 return fetchJSON(
7 `https://api.511.org/transit/StopMonitoring?api_key=${process.env.transitApiKey}&agency=SF&stopCode=${stopCode}`,
8 );
9};

hnStoryPuremain.tsx1 match

@akkartik•Updated 1 year ago
1import { HNcache } from "https://esm.town/v/akkartik/HNcache";
2
3// traverse parent links up to story, but don't make any API requests
4export let hnStoryPure = async (post) => {
5 while (post.parent) {

myApimain.tsx1 match

@raymondcamden•Updated 1 year ago
1export function myApi(name, color = "blue") {
2 return `Hello ${name}, your favorite color is ${color}.`;
3}

myApimain.tsx1 match

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

githubEventsmain.tsx1 match

@endingwithali•Updated 1 year ago
3// GitHub events
4export let githubEvents = fetchJSON(
5 "https://api.github.com/users/stevekrouse/events"
6);

fetchWeatherPredictionmain.tsx3 matches

@jamiedubs•Updated 1 year ago
9 shortForecast: string;
10 }
11 interface WeatherApiResponse {
12 properties: {
13 periods: Forecast[];
21 // Fetch the points data to get the forecast endpoint
22 const pointsUrl: string =
23 `https://api.weather.gov/points/${latitude},${longitude}`;
24 console.log(pointsUrl);
25 const pointsResponse = await fetch(pointsUrl, {
33 headers: { "Accept": "application/geo+json" },
34 });
35 const forecastData: WeatherApiResponse = await forecastResponse.json();
36 console.log({ forecastData });
37 return forecastData.properties.periods;

myApimain.tsx1 match

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

getChatgptmain.tsx1 match

@bingo16•Updated 1 year ago
21
22 const getCompelitoins = async (data) => {
23 const response = await fetch("https://api.openai.com/v1/completions", {
24 method: "POST",
25 headers: {

daily-advice-app1 file match

@dcm31•Updated 1 day ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaine•Updated 2 days ago
aquapi
apiv1