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=476&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 5057 results for "api"(427ms)

textToImageDallemain.tsx1 match

@stevekrouse•Updated 1 year ago
17 };
18 } = await fetchJSON(
19 "https://api.openai.com/v1/images/generations",
20 {
21 method: "POST",

valTownApiExampleUsermain.tsx2 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let valTownApiExampleUser = (async () => {
4 const handle = "tmcw";
5 const response = await fetch(`https://api.val.town/v1/alias/${handle}`);
6 const json = await response.json();
7 return json;

githubStarredmain.tsx1 match

@stevekrouse•Updated 1 year ago
3// Cities named Brooklyn
4export let githubStarred = fetchJSON(
5 "https://api.github.com/users/stevekrouse/starred",
6);

openAqNowcastAQImain.tsx1 match

@stevekrouse•Updated 1 year ago
5export async function openAqNowcastAQI({ location_id }) {
6 const { results } = await fetchJSON(
7 "https://api.openaq.org/v2/measurements?" +
8 new URLSearchParams({
9 limit: "100",

importGistsmain.tsx1 match

@stevekrouse•Updated 1 year ago
7 const supportedLanguages = ["JavaScript", "TypeScript"];
8 let imported = [];
9 const headers = { "X-GitHub-Api-Version": "2022-11-28" };
10 const { Octokit } = await import("npm:@octokit/core");
11 const octokit = new Octokit({ auth: githubToken });

twitterAPIDownAlertmain.tsx5 matches

@stevekrouse•Updated 1 year ago
1import { twitterAPIDown } from "https://esm.town/v/stevekrouse/twitterAPIDown";
2
3export async function twitterAPIDownAlert() {
4 if (twitterAPIDown.down)
5 console.email(
6 twitterAPIDown.reason,
7 "Twitter API may be down!"
8 );
9}

runAllTestsmain.tsx8 matches

@stevekrouse•Updated 1 year ago
3export async function runAllTests({
4 names,
5 api,
6}: {
7 names: string[];
8 api: string;
9}) {
10 let validAPI =
11 api.startsWith("http://localhost") ||
12 api.startsWith("https://api.val.town");
13 if (!validAPI) return "bad api";
14 let results = [];
15 for (let name of names) {
16 console.log(
17 `${api}/eval/@stevekrouse.${name}("${encodeURIComponent(api)}")`
18 );
19 results.push(
20 (
21 await fetchJSON(
22 `${api}/eval/@stevekrouse.${name}("${encodeURIComponent(api)}")`
23 )
24 ).data + ` (${name})`

langchainExmain.tsx1 match

@stevekrouse•Updated 1 year ago
7 const model = new OpenAI({
8 temperature: 0.9,
9 openAIApiKey: process.env.openai,
10 maxTokens: 100,
11 });

githubEventsmain.tsx1 match

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

spotifyDiscoverWeeklyPlaylistmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { spotifyAPI } from "https://esm.town/v/stevekrouse/spotifyAPI";
2
3export let spotifyDiscoverWeeklyPlaylist = async (token) =>{
4 let search = await spotifyAPI({
5 endpoint: 'search',
6 q: 'Discover Weekly',

runValAPIEx2 file matches

@charmaine•Updated 14 hours ago

PassphraseAPI2 file matches

@wolf•Updated 3 days ago
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com
fiberplane
Purveyors of Hono tooling, API Playground enthusiasts, and creators of 🪿 HONC 🪿 (https://honc.dev)