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%20%22Image%20title%22?q=api&page=923&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 14947 results for "api"(1409ms)

spotifyAPImain.tsx2 matches

@neverstew•Updated 3 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let spotifyAPI = ({ token, endpoint, ...params }) =>
4 fetchJSON(
5 `https://api.spotify.com/v1/${endpoint}${
6 "method" in params && ["POST", "PUT", "DELETE"].includes(params["method"])
7 ? ""

spotifyGetPlaylistmain.tsx2 matches

@neverstew•Updated 3 months ago
1import { spotifyAPI } from "https://esm.town/v/stevekrouse/spotifyAPI";
2
3export let spotifyGetPlaylist = async (id, { token, ...params }) =>
4 spotifyAPI({
5 token,
6 endpoint: `playlists/${id}?${new URLSearchParams(params).toString()}`,

spotifyCreatePlaylistmain.tsx2 matches

@neverstew•Updated 3 months ago
1import { spotifyAPI } from "https://esm.town/v/stevekrouse/spotifyAPI";
2
3export let spotifyCreatePlaylist = async ({ token, ...params }) =>
4 spotifyAPI({
5 token,
6 endpoint: `users/funkmastermatt/playlists`,

getSpotifyAccessTokenmain.tsx2 matches

@neverstew•Updated 3 months ago
52 try {
53 // Get access token
54 const response = await fetch("https://accounts.spotify.com/api/token", {
55 method: "POST",
56 headers: {
69 return accessToken;
70 }
71 console.error("Bad response from Spotify API", await response.text());
72 throw Error("Unable to request Spotify Access Token");
73 } catch (e) {

getSpotifyAccessTokenREADME.md1 match

@neverstew•Updated 3 months ago
1# getSpotifyAccess Token
2
3Request an access token for use with the Spotify Web API.
4
5Requires environment variables from your Spotify Developers account.

mightyAmberTakinREADME.md2 matches

@aashish•Updated 3 months ago
6
71. Sign up for [Cerebras](https://cloud.cerebras.ai/)
82. Get a Cerebras API Key
93. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`
10
11# Todos

mightyAmberTakinmain.tsx4 matches

@aashish•Updated 3 months ago
212 } catch (error) {
213 Toastify({
214 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
215 position: "center",
216 duration: 3000,
1024 };
1025 } else {
1026 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1027 const completion = await client.chat.completions.create({
1028 messages: [
1148 <meta name="viewport" content="width=device-width, initial-scale=1.0">
1149 <title>CerebrasCoder</title>
1150 <link rel="preconnect" href="https://fonts.googleapis.com" />
1151 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1152 <link
1153 href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
1154 rel="stylesheet"
1155 />

moralCoffeeSkinkREADME.md2 matches

@aashish•Updated 3 months ago
6
71. Sign up for [Cerebras](https://cloud.cerebras.ai/)
82. Get a Cerebras API Key
93. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`
10
11# Todos

moralCoffeeSkinkmain.tsx4 matches

@aashish•Updated 3 months ago
212 } catch (error) {
213 Toastify({
214 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
215 position: "center",
216 duration: 3000,
1024 };
1025 } else {
1026 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1027 const completion = await client.chat.completions.create({
1028 messages: [
1148 <meta name="viewport" content="width=device-width, initial-scale=1.0">
1149 <title>CerebrasCoder</title>
1150 <link rel="preconnect" href="https://fonts.googleapis.com" />
1151 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1152 <link
1153 href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
1154 rel="stylesheet"
1155 />

InvocationTrackerREADME.md1 match

@rozek•Updated 3 months ago
51**The "InvocationTracker" is designed to be accessed simultaneously from multiple concurrently running vals without interfering with each other.**
52
53## API Reference ##
54
55- `static async new (Name:string, Granularity:number = 15*60*1000):Promise<InvocationTracker>`<br>

HN-fetch-call2 file matches

@ImGqb•Updated 8 hours ago
fetch HackerNews by API

token-server1 file match

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