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=951&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 12426 results for "api"(3274ms)

password_authmain.tsx4 matches

@kamekUpdated 11 months ago
61
62async function fetchUser(token: string): Promise<{ id: string }> {
63 const resp = await fetch("https://api.val.town/v1/me", {
64 headers: {
65 Authorization: `Bearer ${token}`,
74}
75
76async function verifyApiToken(token: string) {
77 try {
78 const [currentUser, requestUser] = await Promise.all([fetchUser(Deno.env.get("valtown")), fetchUser(token)]);
92 <article>
93 <p>This val website is <a href="https://www.val.town/v/pomdtr/password_auth">protected by a password</a>.</p>
94 <p>If you are <a href="https://val.town/u/${handle}">@${handle}</a>, you can access it using an <a href="https://www.val.town/settings/api">API token</a>.</p>
95 <p>If not, you'll need to contact the author for access.</p>
96 <footer>
147 const formData = await req.formData();
148 const password = formData.get("password") as string;
149 if (!passwords.includes(password) && !(await verifyApiToken(password))) {
150 return new Response("Unauthorized", {
151 status: 403,

twitterAlertREADME.md1 match

@rkartzmanUpdated 11 months ago
25Todos:
26
27- this should filter the twitter API call to only tweets since the last run.
28- some kind of caching to avoid rate limiting
29- would be nice to use the user's feed instead of a username list... but not sure how easy that is

valwriter_react_clientsidemain.tsx1 match

@stevekrouseUpdated 11 months ago
122 console.log(result.rows[0]);
123
124 // Blob storage API
125 import { blob } from "https://esm.town/v/std/blob";
126 const key = "blob_test";

valTownChatGPTmain.tsx1 match

@maxmUpdated 11 months ago
3import { renderToString } from "npm:react-dom/server";
4
5// This uses by personal API key, you'll need to provide your own if
6// you fork this. We'll be adding support to the std/openai lib soon!
7const openai = new OpenAI();

chatGPTREADME.md1 match

@stevekrouseUpdated 11 months ago
10</p>
11
12**⚠️ Note: Requires your own OpenAI API key to get this to run in a fork**
13
14Migrated from folder: Archive/chatGPT

twitterAlertREADME.md1 match

@sefllessUpdated 11 months ago
25Todos:
26
27- this should filter the twitter API call to only tweets since the last run.
28- some kind of caching to avoid rate limiting
29- would be nice to use the user's feed instead of a username list... but not sure how easy that is

getTweetsmain.tsx6 matches

@geoffreylittUpdated 11 months ago
5// config({ export: true });
6
7// Twitter API endpoint for user tweets
8const endpointUrl = "https://api.twitter.com/2/tweets";
9
10// Twitter API bearer token
11const bearerToken = Deno.env.get("twitter");
12
13if (!bearerToken) {
14 console.error("Please set your Twitter API Bearer Token in the environment variables.");
15 Deno.exit(1);
16}
18// Function to fetch tweets from a user
19export async function getTweets(username: string) {
20 const userUrl = `https://api.twitter.com/2/users/by/username/${username}`;
21 const userResponse = await fetch(userUrl, {
22 headers: {
33 const userId = userData.data.id;
34
35 const tweetsUrl = `https://api.twitter.com/2/users/${userId}/tweets`;
36 const tweetsResponse = await fetch(tweetsUrl, {
37 headers: {

sqliteExplorerAppREADME.md1 match

@dtkavUpdated 11 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

@dtkavUpdated 11 months ago
26 <head>
27 <title>SQLite Explorer</title>
28 <link rel="preconnect" href="https://fonts.googleapis.com" />
29
30 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
31 <link
32 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"
33 rel="stylesheet"
34 />

twitterDailyDigestREADME.md1 match

@geoffreylittUpdated 11 months ago
25Todos:
26
27- this should filter the twitter API call to only tweets since the last run.
28- some kind of caching to avoid rate limiting
29- would be nice to use the user's feed instead of a username list... but not sure how easy that is

vapi-minutes-db2 file matches

@henrywilliamsUpdated 2 hours ago

social_data_api_project3 file matches

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