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=550&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 10974 results for "api"(1637ms)

aqiREADME.md1 match

@myhandle•Updated 3 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

humbleBlushSeahorsemain.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 = "\"node.js\" OR \"node\"";
6const mentionsDiscord = Deno.env.get("mentionsDiscord");
7const serpApiKey = Deno.env.get("SERP_API_KEY");
8
9export async function redditAlert({ lastRunAt }: Interval) {
10 if (!serpApiKey || !mentionsDiscord) {
11 console.error("Missing SERP_API_KEY or Discord webhook URL. Exiting.");
12 return;
13 }
15 console.log(lastRunAt);
16
17 // 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
18 const asQdr = lastRunAt
19 ? `d${Math.floor((Date.now() - lastRunAt.getTime()) / (24 * 60 * 60 * 1000))}`
21
22 try {
23 const response = await searchWithSerpApi({
24 query,
25 site: "reddit.com",
26 apiKey: serpApiKey,
27 as_qdr: asQdr,
28 });

humbleBlushSeahorseREADME.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.

divineCyanAnglerfishREADME.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.

divineCyanAnglerfishmain.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 mentionsDiscord = Deno.env.get("mentionsDiscord");
7const serpApiKey = Deno.env.get("SERP_API_KEY");
8
9export async function redditAlert({ lastRunAt }: Interval) {
10 if (!serpApiKey || !mentionsDiscord) {
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 });

redditAlertmain.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 = "\"node.js\" OR \"node\"";
6const mentionsDiscord = Deno.env.get("mentionsDiscord");
7const serpApiKey = Deno.env.get("SERP_API_KEY");
8
9export async function redditAlert({ lastRunAt }: Interval) {
10 if (!serpApiKey || !mentionsDiscord) {
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 });

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.

daily-advice-app1 file match

@dcm31•Updated 2 days ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaine•Updated 3 days ago
apiv1
papimark21