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=630&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 12013 results for "api"(1036ms)

firstValTestmain.tsx1 match

@YuryKonvpaltoUpdated 3 months ago
5
6const replicate = new Replicate({
7 auth: Deno.env.get("REPLICATE_API_TOKEN"),
8});
9

cerebras_codermain.tsx5 matches

@Sushant_99Updated 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: [
1149 <meta name="viewport" content="width=device-width, initial-scale=1.0">
1150 <title>CerebrasCoder</title>
1151 <link rel="preconnect" href="https://fonts.googleapis.com" />
1152 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1153 <link
1154 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"
1155 rel="stylesheet"
1156 />
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1168
1169

cerebras_coderREADME.md2 matches

@Sushant_99Updated 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`

suttyCheckinBotmain.tsx4 matches

@nuloUpdated 3 months ago
34}
35
36// Zulip API helpers
37async function getStreamId(streamName) {
38 const response = await fetch(`${ZULIP_URL}/api/v1/get_stream_id?stream=${encodeURIComponent(streamName)}`, {
39 headers: {
40 "Authorization": `Basic ${btoa(`${ZULIP_BOT_EMAIL}:${ZULIP_BOT_KEY}`)}`,
46
47async function getStreamTopics(streamId) {
48 const response = await fetch(`${ZULIP_URL}/api/v1/users/me/${streamId}/topics`, {
49 headers: {
50 "Authorization": `Basic ${btoa(`${ZULIP_BOT_EMAIL}:${ZULIP_BOT_KEY}`)}`,
56
57async function sendMessage(stream, topic, content) {
58 const response = await fetch(`${ZULIP_URL}/api/v1/messages`, {
59 method: "POST",
60 headers: {

spotifyClearPlaylistmain.tsx2 matches

@neverstewUpdated 3 months ago
1import { spotifyAPI } from "https://esm.town/v/stevekrouse/spotifyAPI";
2import { spotifyGetPlaylistTracks } from "https://esm.town/v/neverstew/spotifyGetPlaylistTracks";
3
10 const tracks = tracksRes.items.map(i => i.track);
11
12 return spotifyAPI({
13 token,
14 endpoint: `playlists/${id}/tracks`,

spotifyAPImain.tsx2 matches

@neverstewUpdated 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

@neverstewUpdated 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

@neverstewUpdated 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

@neverstewUpdated 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

@neverstewUpdated 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.

social_data_api_project3 file matches

@tsuchi_yaUpdated 7 hours ago

simple-scrabble-api1 file match

@bryUpdated 3 days ago
papimark21
socialdata
Affordable & reliable alternative to Twitter API: ➡️ Access user profiles, tweets, followers & timeline data in real-time ➡️ Monitor profiles with nearly instant alerts for new tweets, follows & profile updates ➡️ Simple integration