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/$%7Burl%7D?q=api&page=959&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 12884 results for "api"(2514ms)

sqliteExplorerAppREADME.md1 match

@ttodosiUpdated 9 months ago
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans

sqliteExplorerAppmain.tsx2 matches

@ttodosiUpdated 9 months ago
27 <head>
28 <title>SQLite Explorer</title>
29 <link rel="preconnect" href="https://fonts.googleapis.com" />
30
31 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32 <link
33 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34 rel="stylesheet"
35 />

poisedOrangeJellyfishmain.tsx1 match

@jeffreyyoungUpdated 9 months ago
135async function* forward(query: QueryRequest, botName: string, accessKey: string) {
136 console.log(query, botName, accessKey);
137 const req = new Request(`https://api.poe.com/bot/${botName}`, {
138 method: "POST",
139 headers: {

spotifymain.tsx4 matches

@ejfoxUpdated 9 months ago
17 <title>Spotify Playlist Viewer</title>
18 <script src="https://cdn.tailwindcss.com"></script>
19 <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap" rel="stylesheet">
20 <style>
21 body { font-family: 'Poppins', sans-serif; }
59 <title>Spotify Playlists</title>
60 <script src="https://cdn.tailwindcss.com"></script>
61 <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap" rel="stylesheet">
62 <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
63 <style>
85 async function fetchPlaylists() {
86 try {
87 const response = await axios.get('https://api.spotify.com/v1/me/playlists', {
88 headers: { 'Authorization': 'Bearer ' + accessToken }
89 });
113 async function fetchTracks(playlistId, playlistName) {
114 try {
115 const response = await axios.get(\`https://api.spotify.com/v1/playlists/\${playlistId}/tracks\`, {
116 headers: { 'Authorization': 'Bearer ' + accessToken }
117 });

mastodonmain.tsx4 matches

@ejfoxUpdated 9 months ago
1// This val fetches the 10 most recent Mastodon posts using the Mastodon API.
2// It requires a Mastodon access token stored in the MASTODON_TOKEN environment variable.
3
13
14 try {
15 const response = await axios.get(`https://${instance}/api/v1/accounts/verify_credentials`, {
16 headers: { Authorization: `Bearer ${token}` },
17 });
19 const userId = response.data.id;
20
21 const statusesResponse = await axios.get(`https://${instance}/api/v1/accounts/${userId}/statuses`, {
22 headers: { Authorization: `Bearer ${token}` },
23 params: { limit: 10, exclude_replies: true, exclude_reblogs: true },
47 }
48 } else if (error.request) {
49 errorMessage += ": No response received from Mastodon API";
50 } else {
51 errorMessage += `: ${error.message}`;

recentpinboardmain.tsx7 matches

@ejfoxUpdated 9 months ago
1// This approach directly uses axios to request the Pinboard API.
2// It requires a Pinboard API token, which is set as a secret in Val Town.
3
4import axios from "npm:axios";
8
9 if (!token) {
10 return Response.json({ error: "Pinboard API token not set" }, { status: 500 });
11 }
12
13 try {
14 const response = await axios.get(
15 `https://api.pinboard.in/v1/posts/recent?auth_token=${token}&format=json&count=10`,
16 );
17
18 if (response.status !== 200) {
19 throw new Error(`Pinboard API returned status ${response.status}`);
20 }
21
22 if (!response.data || !Array.isArray(response.data.posts)) {
23 throw new Error("Unexpected response format from Pinboard API");
24 }
25
45 }
46 } else if (error.request) {
47 errorMessage += ": No response received from Pinboard API";
48 } else {
49 errorMessage += `: ${error.message}`;

githubcollabgenmain.tsx4 matches

@ejfoxUpdated 9 months ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3const OPENAI_API_KEY = "your_openai_api_key"; // Replace with your actual OpenAI API key
4
5export default async function main(req: Request): Promise<Response> {
11 const threeMonthsAgo = new Date(Date.now() - 90 * 24 * 60 * 60 * 1000).toISOString();
12 const response = await fetch(
13 `https://api.github.com/users/${username}/events?per_page=100&since=${threeMonthsAgo}`,
14 );
15 const data = await response.json();
16 if (!Array.isArray(data)) {
17 throw new Error(`Unexpected GitHub API response for user ${username}`);
18 }
19 return data;
57 const user2Summary = summarizeActivity(user2Data);
58
59 const openai = new OpenAI(OPENAI_API_KEY);
60 const completion = await openai.chat.completions.create({
61 model: "gpt-3.5-turbo",

githubcollabgenREADME.md1 match

@ejfoxUpdated 9 months ago
26## Response
27
28The API returns a plain text response with AI-generated collaboration suggestions, including:
29
301. Potential collaborative projects

githubactivitysummarizermain.tsx8 matches

@ejfoxUpdated 9 months ago
1// This approach fetches GitHub activity for two users specified in the URL,
2// sends it to OpenAI for analysis, and returns collaboration suggestions.
3// It uses the GitHub API (which doesn't require authentication for public data)
4// and the OpenAI API (which does require an API key).
5// Tradeoff: We're using an inline API key for simplicity, which isn't ideal for security.
6// Note: This might hit rate limits for the GitHub API due to fetching a year of data.
7
8import { OpenAI } from "https://esm.town/v/std/openai";
9
10const OPENAI_API_KEY = "your_openai_api_key"; // Replace with your actual OpenAI API key
11
12export default async function main(req: Request): Promise<Response> {
17 async function fetchUserActivity(username: string) {
18 const oneYearAgo = new Date(Date.now() - 365 * 24 * 60 * 60 * 1000).toISOString();
19 const response = await fetch(`https://api.github.com/users/${username}/events?per_page=100&since=${oneYearAgo}`);
20 const data = await response.json();
21 if (!Array.isArray(data)) {
22 throw new Error(`Unexpected GitHub API response for user ${username}`);
23 }
24 return data;
54 const user2Summary = summarizeActivity(user2Data);
55
56 const openai = new OpenAI(OPENAI_API_KEY);
57 const completion = await openai.chat.completions.create({
58 model: "gpt-3.5-turbo",

relationshipgeneratormain.tsx2 matches

@ejfoxUpdated 9 months ago
1// This val receives text input, sends it to OpenAI to generate relationships,
2// and returns a newline-delimited list of relationships.
3// It uses the OpenAI API to generate the relationships.
4// Tradeoff: This approach relies on an external API, which may have rate limits or costs.
5
6// Usage with curl:

vapi-minutes-db1 file match

@henrywilliamsUpdated 1 day ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 1 day ago
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
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com