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%22Optional%20title%22?q=api&page=964&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 13622 results for "api"(1036ms)

twitterAlertREADME.md3 matches

@samwhoUpdated 6 months ago
4
5This val gets Twitter data via [SocialData](https://socialdata.tools) via
6@stevekrouse/socialDataProxy. Val Town Pro users can call this API
7100 times per day, so be sure not to set this cron to run more than once every 15 min.
8If you want to use it more, get your own [SocialData](https://socialdata.tools)
9API token and pay for it directly.
10
11## 1. Query
13Change the `query` variable for what you want to get notified for.
14
15You can use [Twitter's search operators](https://developer.twitter.com/en/docs/twitter-api/v1/rules-and-filtering/search-operators) to customize your query, for some collection of keywords, filtering out others, and much more!
16
17## 2. Notification

gptmemoryREADME.md21 matches

@toowiredUpdated 6 months ago
1A simple Rest API that allows for you GPT to save and recall snippets of data (memories). You can read my blog post explaining it in detail here: [xkonti.tech](https://xkonti.tech/blog/giving-gpt-memory/)
2
3# Demonstration
7![FirstConversation.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/78c48b8b-8a1b-4caf-ef23-2ad78be3a100/public)
8
9What GPT sent do the API:
10
11```json
24# Setup
25
26There are several steps to set up the API:
27- deploy and configure the API
28- create the API key for your GPT
29- add an action for the API in you GPT
30- add prompt section to your GPT so that it can use it properly
31
32## Deploying the API on Val Town
33
34Deploy your own memory API. You can fork the following Val to do it: https://www.val.town/v/xkonti/memoryApiExample
35
36In the code configure the appropriate values:
37
38- `apiName` the name of your API - used in the Privacy Policy (eg. `Memory API`)
39- `contactEmail` - the email to provide for contact in the Privacy Policy (eg. `some@email.com`)
40- `lastPolicyUpdate` - the date the Privacy Policy was last updated (eg. `2023-11-28`)
41- `blobKeyPrefix` - the prefix for the blob storage keys used by your API - more info below (eg. `gpt:memories:`)
42- `apiKeyPrefix` - the prefix for you API Keys secrets - more info below (eg. `GPTMEMORYAPI_KEY_`)
43
44## Create API keys
45
46The Memory API is designed to serve multiple GPTs at the same time. Each GPT should have it's own unique **name** and **API key**.
47
48The **name** is used for identifying the specific GPT and appended to both:
49- `blobKeyPrefix`- to maintain separate memory storage from other GPTs
50- `apiKeyPrefix` - to maintain separate API key for each GPT
51
521. Please pick a unique alphanumeric name for your GPT. For example `personaltrainer`.
532. Generate some alphanumeric API key for your GPT. For example `Wrangle-Chapped-Monkhood4-Domain-Suspend`
543. Add a new secret to your Val.town secrets storage. The Key should be the picked name prefixed by `apiKeyPrefix`. Using the default it would be `GPTMEMORYAPI_KEY_personaltrainer`. The value of the secret should be the API key itself.
55
56The memories of the GPT will be stored in the blob storage under the key `blobKeyPrefix + name`, for example: `gpt:memories:personaltrainer`.
59
601. Add a new action in your GPT.
612. Get the OpenAPI spefication by calling the `/openapi` endpoint of your API
623. Change all `<APIURL>` instances within the specification to the url of your deployed API. For example `https://xkonti-memoryapiexample.web.val.run`
634. Set the authentication method to basic and provide a [base64 encoded](https://www.base64encode.org/) version of the `<name>:<apiKey>`. For example: `personaltrainer:Wrangle-Chapped-Monkhood4-Domain-Suspend` -> `cGVyc29uYWx0cmFpbmVyOldyYW5nbGUtQ2hhcHBlZC1Nb25raG9vZDQtRG9tYWluLVN1c3BlbmQ=`
645. Add the link to the privacy policy, which is the `/privacy` endpoint of your API. For example: `https://xkonti-memoryapiexample.web.val.run/privacy`
65
66## Adding the prompt section
86```
87
88Migrated from folder: APIs/gptmemory

basicAuthREADME.md1 match

@a4v2d4Updated 6 months ago
17```
18
19If you want to use an apiToken as a password:
20
21```ts

assertiveTanMeadowlarkREADME.md1 match

@gwthompsonUpdated 6 months ago
8
91. Click `Fork`
102. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
113. Click `Run`
12

passwordGenmain.tsx11 matches

@allUpdated 6 months ago
157 const [policy, setPolicy] = useState({
158 minLength: 12,
159 requireCapital: true,
160 requireSpecial: true,
161 allowedSpecial: "!@#$%^&*()_+-=[]{}|;:,.<>?",
174 ...policy,
175 minLength: 8,
176 requireCapital: false,
177 requireSpecial: false,
178 });
182 ...policy,
183 minLength: 12,
184 requireCapital: true,
185 requireSpecial: true,
186 });
190 ...policy,
191 minLength: 16,
192 requireCapital: true,
193 requireSpecial: true,
194 });
292 <input
293 type="checkbox"
294 id="requireCapital"
295 checked={policy.requireCapital}
296 onChange={(e) => setPolicy({ ...policy, requireCapital: e.target.checked })}
297 className="w-5 h-5 text-green-600"
298 />
299 <label htmlFor="requireCapital" className="text-lg">Require Capital Letter</label>
300 </div>
301 <div className="flex items-center space-x-2">
453 <meta name="viewport" content="width=device-width, initial-scale=1.0">
454 <title>Advanced Password Generation System</title>
455 <link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;700&display=swap" rel="stylesheet">
456 <script src="https://cdn.tailwindcss.com"></script>
457 <script>
586 password = password.slice(0, insertIndex) + securePhrase + password.slice(insertIndex);
587
588 // Ensure capital letter if required
589 if (policy.requireCapital && !/[A-Z]/.test(password)) {
590 const index = Math.floor(Math.random() * password.length);
591 password = password.slice(0, index) + password[index].toUpperCase() + password.slice(index + 1);

fullPageWebsiteScrapermain.tsx4 matches

@willthereaderUpdated 6 months ago
78 console.log("Debug - Full query being sent:", query);
79
80 console.log(`Making LSD API request for ${websiteUrl}`);
81 const response = await fetch(
82 `https://lsd.so/api?query=${encodeURIComponent(query)}`,
83 );
84
161 a`;
162
163 console.log(`Making LSD API request for ${pageUrl}`);
164 const response = await fetch(
165 `https://lsd.so/api?query=${encodeURIComponent(pageQuery)}`,
166 );
167

htmlToMarkdownConvertermain.tsx1 match

@willowUpdated 6 months ago
114 <title>HTML to Markdown Converter (with Table and Link Support)</title>
115 <meta name="viewport" content="width=device-width, initial-scale=1">
116 <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
117 <style>${css}</style>
118 </head>

sqliteExplorerAppREADME.md1 match

@jaipUpdated 6 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

@jaipUpdated 6 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 />

xmasRedHamstermain.tsx2 matches

@trollishkaUpdated 6 months ago
27
28async function getMostPopularPinterestImage(query: string): Promise<string> {
29 const searchUrl = `https://api.pinterest.com/v5/search/pins?query=${encodeURIComponent(query)}&page_size=50&sort_order=popularity`;
30 const response = await fetch(searchUrl, {
31 headers: {
36
37 if (!response.ok) {
38 throw new Error(`Pinterest API request failed: ${response.statusText}`);
39 }
40

create-val-api-demo1 file match

@shouserUpdated 10 hours ago

new-val-api-demo

@shouserUpdated 10 hours ago
This is an example of using the API to create a val.
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