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/$%7Bart_info.art.src%7D?q=api&page=935&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 12646 results for "api"(3338ms)

notionGetDatabasemain.tsx2 matches

@ttodosi•Updated 9 months ago
4 filter?: any;
5}) => {
6 const { Client, collectPaginatedAPI } = await import(
7 "https://deno.land/x/notion_sdk/src/mod.ts"
8 );
9 const notion = new Client({ auth });
10 return collectPaginatedAPI(notion.databases.query, {
11 database_id: databaseId,
12 filter,

VALLEREADME.md3 matches

@ttodosi•Updated 9 months ago
6* Fork this val to your own profile.
7* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
8* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-variables).
9* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environment-variables).
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.
11
12<img width=500 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7077d1b5-1fa7-4a9b-4b93-f8d01d3e4f00/public"/>

sqliteExplorerAppREADME.md1 match

@ttodosi•Updated 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

@ttodosi•Updated 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

@jeffreyyoung•Updated 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

@ejfox•Updated 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

@ejfox•Updated 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

@ejfox•Updated 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

@ejfox•Updated 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

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

vapi-minutes-db1 file match

@henrywilliams•Updated 10 hours ago

vapi-minutes-db2 file matches

@henrywilliams•Updated 12 hours ago
api
aquapi