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=1039&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 11885 results for "api"(1229ms)

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',

myApimain.tsx1 match

@tangshengnan•Updated 1 year ago
1export function myApi(req, res) {
2 res.set("Content-Type", "application/json");
3 res.send([{ value: "wangtianbao", url: "https://www.967111.net" }]);
18 );
19 const chatModel = new ChatOpenAI({
20 openAIApiKey: process.env.OPENAI_API_KEY,
21 });
22 /* Create the vectorstore */
29 [{ id: 2 }, { id: 1 }, { id: 3 }],
30 new OpenAIEmbeddings({
31 openAIApiKey: process.env.OPENAI_API_KEY,
32 }),
33 );

starWarsmain.tsx2 matches

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

valFormmain.tsx1 match

@rodrigotello•Updated 1 year ago
17 const args = Array.from(formData.values()).map(Number);
18
19 fetch('https://api.val.town/v1/run/rodrigotello.multiplicationFunctionTest', {
20 method: 'POST',
21 headers: { 'Content-Type': 'application/json' },

selfmain.tsx1 match

@eralp•Updated 1 year ago
2
3export let self = async () {
4 const response = await fetch("https://api.val.town/eval/@eralp.self")
5 const json = await response.json();
6 return json.data;

githubFollowersmain.tsx1 match

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

social_data_api_project3 file matches

@tsuchi_ya•Updated 11 hours ago

simple-scrabble-api1 file match

@bry•Updated 1 day ago
apiv1
papimark21