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=506&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 8532 results for "api"(674ms)

redditAlertREADME.md10 matches

@charmainetest•Updated 3 months ago
72. Send notifications to your preferred platform (Discord, Slack, email, etc.)
8
9Reddit does not have an API that allows users to scrape data, so we are doing this with the Google Search API, [Serp](https://serpapi.com/).
10
11---
29
30---
31### 3. Get a SerpApi Key
32This template requires a [SerpApi](https://serpapi.com/) key to search Reddit posts via Google search results.
33
341. **Get a SerpApi key**:
35 - Sign up at [SerpApi](https://serpapi.com/) to create an account.
36 - Generate an API key from your account dashboard.
37
382. **Add the SerpApi key to your environment variables**:
39 - Go to your [Val Town environment variables](https://www.val.town/settings/environment-variables).
40 - Add a new key:
41 - Key: `SERP_API_KEY`
42 - Value: Your SERP API key.
43
44Without this key, the val will not function correctly.
75
76### NOTE: Usage Limits
77- **SerpApi:** Free SerpApi accounts have monthly call limits.

redditAlertREADME.md10 matches

@charmaine•Updated 3 months ago
72. Send notifications to your preferred platform (Discord, Slack, email, etc.)
8
9Reddit does not have an API that allows users to scrape data, so we are doing this with the Google Search API, [Serp](https://serpapi.com/).
10
11---
29
30---
31### 3. Get a SerpApi Key
32This template requires a [SerpApi](https://serpapi.com/) key to search Reddit posts via Google search results.
33
341. **Get a SerpApi key**:
35 - Sign up at [SerpApi](https://serpapi.com/) to create an account.
36 - Generate an API key from your account dashboard.
37
382. **Add the SerpApi key to your environment variables**:
39 - Go to your [Val Town environment variables](https://www.val.town/settings/environment-variables).
40 - Add a new key:
41 - Key: `SERP_API_KEY`
42 - Value: Your SERP API key.
43
44Without this key, the val will not function correctly.
75
76### NOTE: Usage Limits
77- **SerpApi:** Free SerpApi accounts have monthly call limits.

grandCoffeeSquirrelmain.tsx7 matches

@charmainetest•Updated 3 months ago
1import { searchWithSerpApi } from "https://esm.town/v/charmaine/searchWithSerpApi";
2import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
3
5const query = "\"val town\" OR \"val.town\"";
6const discordWebhookUrl = Deno.env.get("mentionsDiscord");
7const serpApiKey = Deno.env.get("SERP_API_KEY");
8
9export async function redditAlert({ lastRunAt }: Interval) {
10 if (!serpApiKey || !discordWebhookUrl) {
11 console.error("Missing SERP_API_KEY or Discord webhook URL. Exiting.");
12 return;
13 }
14
15 // Calculate the `as_qdr` parameter (https://serpapi.com/advanced-google-query-parameters#api-parameters-advanced-search-query-parameters-as-qdr) or default to 7 days
16 const asQdr = lastRunAt
17 ? `d${Math.floor((Date.now() - lastRunAt.getTime()) / (24 * 60 * 60 * 1000))}`
19
20 try {
21 const response = await searchWithSerpApi({
22 query,
23 site: "reddit.com",
24 apiKey: serpApiKey,
25 as_qdr: asQdr,
26 });

grandCoffeeSquirrelREADME.md10 matches

@charmainetest•Updated 3 months ago
72. Send notifications to your preferred platform (Discord, Slack, email, etc.)
8
9Reddit does not have an API that allows users to scrape data, so we are doing this with the Google Search API, [Serp](https://serpapi.com/).
10
11---
29
30---
31### 3. Get a SerpApi Key
32This template requires a [SerpApi](https://serpapi.com/) key to search Reddit posts via Google search results.
33
341. **Get a SerpApi key**:
35 - Sign up at [SerpApi](https://serpapi.com/) to create an account.
36 - Generate an API key from your account dashboard.
37
382. **Add the SerpApi key to your environment variables**:
39 - Go to your [Val Town environment variables](https://www.val.town/settings/environment-variables).
40 - Add a new key:
41 - Key: `SERP_API_KEY`
42 - Value: Your SERP API key.
43
44Without this key, the val will not function correctly.
75
76### NOTE: Usage Limits
77- **SerpApi:** Free SerpApi accounts have monthly call limits.

tangibleBlackTigermain.tsx7 matches

@charmainetest•Updated 3 months ago
1import { SearchResult, searchWithSerpApi } from "https://esm.town/v/charmaine/searchWithSerpApi";
2import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
3
5const KEYWORDS = ["node"];
6const EXCLUDES = "";
7const DISCORD_API_KEY = Deno.env.get("mentionsDiscord");
8const SERP_API_KEY = Deno.env.get("SERP_API_KEY");
9
10export default async function redditTestAlert({ lastRunAt }: Interval) {
19 );
20
21 // Perform searches using SERP API on reddit.com
22 const results = await Promise.all(
23 searchQueries.map((query) =>
24 searchWithSerpApi({
25 query,
26 site: "reddit.com",
27 apiKey: SERP_API_KEY,
28 })
29 ),
49 try {
50 await discordWebhook({
51 url: DISCORD_API_KEY, // Make sure this is set in your environment variables
52 content: `${message}`,
53 });

tangibleBlackTigerREADME.md10 matches

@charmainetest•Updated 3 months ago
72. Send notifications to your preferred platform (Discord, Slack, email, etc.)
8
9Reddit does not have an API that allows users to scrape data, so we are doing this with the Google Search API, [Serp](https://serpapi.com/).
10
11---
29
30---
31### 3. Get a SerpApi Key
32This template requires a [SerpApi](https://serpapi.com/) key to search Reddit posts via Google search results.
33
341. **Get a SerpApi key**:
35 - Sign up at [SerpApi](https://serpapi.com/) to create an account.
36 - Generate an API key from your account dashboard.
37
382. **Add the SerpApi key to your environment variables**:
39 - Go to your [Val Town environment variables](https://www.val.town/settings/environment-variables).
40 - Add a new key:
41 - Key: `SERP_API_KEY`
42 - Value: Your SERP API key.
43
44Without this key, the val will not function correctly.
75
76### NOTE: Usage Limits
77- **SerpApi:** Free SerpApi accounts have monthly call limits.

honestMagentaCranemain.tsx7 matches

@charmaine•Updated 3 months ago
1import { SearchResult, searchWithSerpApi } from "https://esm.town/v/charmaine/searchWithSerpApi";
2import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
3
5const KEYWORDS = ["node"];
6const EXCLUDES = "";
7const DISCORD_API_KEY = Deno.env.get("mentionsDiscord");
8const SERP_API_KEY = Deno.env.get("SERP_API_KEY");
9
10export default async function redditAlert({ lastRunAt }: Interval) {
19 );
20
21 // Perform searches using SERP API on reddit.com
22 const results = await Promise.all(
23 searchQueries.map((query) =>
24 searchWithSerpApi({
25 query,
26 site: "reddit.com",
27 apiKey: SERP_API_KEY,
28 })
29 ),
49 try {
50 await discordWebhook({
51 url: DISCORD_API_KEY, // Make sure this is set in your environment variables
52 content: `${message}`,
53 });

honestMagentaCraneREADME.md10 matches

@charmaine•Updated 3 months ago
72. Send notifications to your preferred platform (Discord, Slack, email, etc.)
8
9Reddit does not have an API that allows users to scrape data, so we are doing this with the Google Search API, [Serp](https://serpapi.com/).
10
11---
29
30---
31### 3. Get a SerpApi Key
32This template requires a [SerpApi](https://serpapi.com/) key to search Reddit posts via Google search results.
33
341. **Get a SerpApi key**:
35 - Sign up at [SerpApi](https://serpapi.com/) to create an account.
36 - Generate an API key from your account dashboard.
37
382. **Add the SerpApi key to your environment variables**:
39 - Go to your [Val Town environment variables](https://www.val.town/settings/environment-variables).
40 - Add a new key:
41 - Key: `SERP_API_KEY`
42 - Value: Your SERP API key.
43
44Without this key, the val will not function correctly.
75
76### NOTE: Usage Limits
77- **SerpApi:** Free SerpApi accounts have monthly call limits.

scholarlyIvoryMosquitomain.tsx7 matches

@charmainetest•Updated 3 months ago
1import { SearchResult, searchWithSerpApi } from "https://esm.town/v/charmaine/searchWithSerpApi";
2import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
3
6const DAYS_BACK = 1;
7const EXCLUDES = "";
8const DISCORD_API_KEY = Deno.env.get("mentionsDiscord");
9const SERP_API_KEY = Deno.env.get("SERP_API_KEY");
10
11export default async function redditAlert() {
13 const searchQueries = KEYWORDS.map((k) => `"${k}" ${EXCLUDES}`);
14
15 // Perform searches using SERP API on reddit.com
16 const results = await Promise.all(
17 searchQueries.map((query) =>
18 searchWithSerpApi({
19 query,
20 site: "reddit.com",
21 daysBack: DAYS_BACK,
22 apiKey: SERP_API_KEY,
23 })
24 ),
44 try {
45 await discordWebhook({
46 url: DISCORD_API_KEY, // Make sure this is set in your environment variables
47 content: `${message}`,
48 });

scholarlyIvoryMosquitoREADME.md10 matches

@charmainetest•Updated 3 months ago
72. Send notifications to your preferred platform (Discord, Slack, email, etc.)
8
9Reddit does not have an API that allows users to scrape data, so we are doing this with the Google Search API, [Serp](https://serpapi.com/).
10
11---
29
30---
31### 3. Get a SerpApi Key
32This template requires a [SerpApi](https://serpapi.com/) key to search Reddit posts via Google search results.
33
341. **Get a SerpApi key**:
35 - Sign up at [SerpApi](https://serpapi.com/) to create an account.
36 - Generate an API key from your account dashboard.
37
382. **Add the SerpApi key to your environment variables**:
39 - Go to your [Val Town environment variables](https://www.val.town/settings/environment-variables).
40 - Add a new key:
41 - Key: `SERP_API_KEY`
42 - Value: Your SERP API key.
43
44Without this key, the val will not function correctly.
75
76### NOTE: Usage Limits
77- **SerpApi:** Free SerpApi accounts have monthly call limits.

daily-advice-app1 file match

@dcm31•Updated 21 hours ago
Random advice app using Advice Slip API

runValAPIEx2 file matches

@charmaine•Updated 1 day ago
substrate
Substrate is the modular API for fast multi-step AI programs
fiberplane
Purveyors of Hono tooling, API Playground enthusiasts, and creators of 🪿 HONC 🪿 (https://honc.dev)