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/$2?q=api&page=1399&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 15466 results for "api"(3486ms)

spellCheckmain.tsx2 matches

@steveb1313•Updated 1 year ago
2
3export async function spellCheck(req: express.Request, res: express.Response) {
4 let response = await fetch("https://www.dnd5eapi.co/api/spells");
5 let data = await response.json();
6 let countOfSpells = data["count"];
8 let randomSpell = data["results"][randomSpellNumber];
9 let response2 = await fetch(
10 `https://www.dnd5eapi.co/api/spells/${randomSpell["index"]}`,
11 );
12 let data2 = await response2.json();

tellmain.tsx1 match

@dvergin•Updated 1 year ago
1export let tell = (msg) => return `I heard you say ${msg}`;
2//Can call w/URL with: https://api.val.town/eval/@dvergin.tell('Howdy')

myApimain.tsx1 match

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

myApimain.tsx1 match

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

openAQLocationmain.tsx1 match

@tmcw•Updated 1 year ago
13 // Test
14 const { results } = fetchJSON(
15 "https://api.openaq.org/v2/locations?" +
16 new URLSearchParams({
17 // This is a comment

hnSearchmain.tsx2 matches

@stevekrouse•Updated 1 year ago
3
4/* Search Hacker News via Agolia
5Look for the valid params: https://hn.algolia.com/api */
6export let hnSearch = async ({
7 search_by_date,
17 let cleaned_params = await searchParams(params);
18 let data = await fetchJSON(
19 `http://hn.algolia.com/api/v1/${type}?${cleaned_params}`
20 );
21 if (!data.hits && data.message) {

discordChannelmain.tsx1 match

@stevekrouse•Updated 1 year ago
3export function discordChannel({ botToken, serverId }) {
4 return fetchJSON(
5 `https://discord.com/api/guilds/${serverId}/channels`,
6 {
7 headers: {

spotifyAddToPlaylistmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { spotifyAPI } from "https://esm.town/v/stevekrouse/spotifyAPI";
2
3export let spotifyAddToPlaylist = ({ id, ...params }) => spotifyAPI({
4 endpoint: `playlists/${id}/tracks`,
5 method: 'POST',

addSendGridEmailmain.tsx1 match

@stevekrouse•Updated 1 year ago
3// called by supabase newsletter trigger (defined in sql editor)
4export let addSendGridEmail = ({ token, email, listId }) =>
5 fetchJSON("https://api.sendgrid.com/v3/marketing/contacts", {
6 method: "PUT",
7 headers: {

getWeatherByCoordsmain.tsx1 match

@onemanwenttomow•Updated 1 year ago
3export async function getWeatherByCoords(lat, long) {
4 const weather = await fetchJSON(
5 `https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${long}&hourly=temperature_2m,precipitation_probability&forecast_days=1`,
6 );
7 return weather;

HN-fetch-call2 file matches

@ImGqb•Updated 2 days ago
fetch HackerNews by API

token-server1 file match

@kwhinnery_openai•Updated 3 days ago
Mint tokens to use with the OpenAI Realtime API for WebRTC
Kapil01
apiv1