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=849&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 11410 results for "api"(1306ms)

feedsmain.tsx1 match

@nws•Updated 10 months ago
50 // gets all posts under #StateWX and returns them
51 const res = await fetch(
52 `https://public.api.bsky.app/xrpc/app.bsky.feed.searchPosts?q=%23${state}&limit=50&sort=latest`,
53 ).then((res) => res.json());
54 let posts = [];

amaranthPlanarianREADME.md1 match

@ikbear•Updated 10 months ago
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## 3. Notification

twitterAlertREADME.md1 match

@ikbear•Updated 10 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

aqiREADME.md1 match

@chen•Updated 10 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

upload_jsonmain.tsx1 match

@stevedylandev•Updated 10 months ago
13 },
14 });
15 const res = await fetch("https://api.pinata.cloud/pinning/pinJSONToIPFS", {
16 method: "POST",
17 headers: {

twitterAlertREADME.md1 match

@chen•Updated 10 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

sqliteExplorerAppREADME.md1 match

@kamek•Updated 10 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

@kamek•Updated 10 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 />

password_authREADME.md2 matches

@kamek•Updated 10 months ago
11## Usage
12
13If you want to use an [api token](https://www.val.town/settings/api) to authenticate:
14
15```ts
41```
42
43Note that authenticating using your api token remain an option even after setting a password.
44
45## TODO

password_authmain.tsx4 matches

@kamek•Updated 10 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,

mod-interview-api1 file match

@twschiller•Updated 11 hours ago

daily-advice-app1 file match

@dcm31•Updated 3 days ago
Random advice app using Advice Slip API
apiv1
papimark21