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=784&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 11714 results for "api"(924ms)

githubPRAlertmain.tsx4 matches

@campsiteUpdated 6 months ago
8 * 1. Fork this val
9 * 2. Create a custom integration in your Campsite organization settings [1]
10 * 3. Add the API token as an environment variable named `CAMPSITE_API_TOKEN` in Val Town
11 * 4. Add the project ID where you want to create alerts as `PR_ALERTS_PROJECT_ID`
12 * 5. Copy the HTTP endpoint for this Val and add it as a webhook in your GitHub settings [2]
16 * [2] https://github.com/<username>/<repo>/settings/hooks
17 *
18 * Campsite API docs:
19 * https://campsite.com/docs
20 */
22
23// These environment variables are required:
24const CAMPSITE_API_KEY = Deno.env.get("CAMPSITE_API_KEY");
25
26// Set these to your own values:
32 }
33
34 const campsite = new Campsite({ apiKey: CAMPSITE_API_KEY });
35
36 try {

email_channelmain.tsx5 matches

@campsiteUpdated 6 months ago
6
7// Required environment variables
8const CAMPSITE_API_KEY = Deno.env.get("CAMPSITE_EMAILS_API_KEY");
9const CAMPSITE_CHANNEL_ID = "<your-channel-id>";
10
15// Other providers are available via Vercel's AI SDK:
16// https://sdk.vercel.ai/docs/introduction#model-providers
17const OPENAI_API_KEY = Deno.env.get("OPENAI_API_KEY");
18
19const campsite = new Campsite({ apiKey: CAMPSITE_API_KEY });
20
21export async function emailValHandler(payload: Email) {
29 let subject = payload.subject || "Forwarded email (no subject)";
30
31 if (OPENAI_API_KEY) {
32 const openai = createOpenAI({ apiKey: OPENAI_API_KEY });
33
34 // Extract name and email from the forwarded message

dailyStandupmain.tsx3 matches

@campsiteUpdated 6 months ago
7 * https://www.campsite.com/blog/effective-daily-standups-for-distributed-teams
8 *
9 * Campsite API docs:
10 * https://campsite.com/docs
11 */
13
14// These environment variables are required:
15const CAMPSITE_API_KEY = Deno.env.get("CAMPBOT_API_KEY");
16
17// Set these to your own values:
37 });
38
39 const campsite = new Campsite({ apiKey: CAMPSITE_API_KEY });
40
41 await campsite.posts.create({

axiomNotifiermain.tsx5 matches

@campsiteUpdated 6 months ago
7 * [1] https://axiom.co
8 *
9 * Campsite API docs:
10 * https://campsite.com/docs
11 */
12
13// These environment variables are required:
14const CAMPSITE_API_KEY = Deno.env.get("CAMPSITE_API_KEY");
15
16// Set these to your own values:
40
41 const campsiteResponse = await fetch(
42 `https://api.campsite.com/v2/threads/${CAMPSITE_ALERTS_THREAD_ID}/messages`,
43 {
44 method: "POST",
45 headers: {
46 "Content-Type": "application/json",
47 Authorization: `Bearer ${CAMPSITE_API_KEY}`,
48 },
49 body: JSON.stringify({
54
55 if (!campsiteResponse.ok) {
56 throw new Error(`Campsite API error: ${campsiteResponse.statusText}`);
57 }
58

ezzzzmain.tsx1 match

@temptempUpdated 6 months ago
114 <title>Course Content Viewer</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>

blob_adminREADME.md1 match

@tangentUpdated 6 months ago
11[![](https://stevekrouse-button.web.val.run/Install)](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
12
13It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
14
15# TODO

modifyImageREADME.md1 match

@mrtUpdated 6 months ago
1Code from https://deno.com/blog/build-image-resizing-api
2
3Useful for compressing an image before sending to chatgpt4v, for example

dailyScheduleTrackerREADME.md1 match

@mrtUpdated 6 months ago
6- **Analogue Clock Schedule:** Displays daily activities in an analogue clock format with segments representing different time slots.
7- **Chore Tracker:** Lists chores for the day, with checkboxes for completion tracking.
8- **Customizable:** Accepts schedule and todoList props, allowing dynamic data from APIs or other sources.
9- **Real-time Updates:** The clock updates every second to show the current time.
10- **Responsive Design:** Styled with Tailwind CSS for a modern and clean appearance.

getLatestGitHubRunREADME.md2 matches

@kaleidawaveUpdated 6 months ago
10TODO
11- Add handling for no runs etc
12- Handling for GitHub API limits
13- API versioning
14
15Migrated from folder: examples/getLatestGitHubRun

apimain.tsx22 matches

@campsiteUpdated 6 months ago
93
94export type RequestOptions = {
95 apiKey?: string;
96};
97
98type CampsiteAPIOptions = {
99 baseUrl?: string;
100};
103
104/**
105 * Campsite API Client
106 */
107export class CampsiteAPI {
108 private apiKey: string;
109 private baseUrl: string;
110
111 constructor(apiKey?: string, options?: CampsiteAPIOptions) {
112 this.apiKey = apiKey || Deno.env.get("CAMPSITE_API_KEY") || "";
113 this.baseUrl = options?.baseUrl || "https://api.campsite.com/v2";
114 }
115
135 const headers = {
136 "Content-Type": "application/json",
137 Authorization: `Bearer ${this.apiKey}`,
138 };
139
147 const errorData = await response.json();
148 console.error(errorData);
149 throw new Error(`API request failed: ${response.statusText}`);
150 }
151
199}
200
201function createCampsiteAPI(options?: RequestOptions): CampsiteAPI {
202 return new CampsiteAPI(options?.apiKey);
203}
204
205export async function getPost(postId: string, options?: RequestOptions) {
206 const api = createCampsiteAPI(options);
207 return api.getPost(postId);
208}
209
212 options?: RequestOptions
213) {
214 const api = createCampsiteAPI(options);
215 return api.createPost(data);
216}
217
220 options?: RequestOptions
221) {
222 const api = createCampsiteAPI(options);
223 return api.createComment(data);
224}
225
228 options?: RequestOptions
229) {
230 const api = createCampsiteAPI(options);
231 return api.createMessage(data);
232}
233
236 options?: RequestOptions
237) {
238 const api = createCampsiteAPI(options);
239 return api.listChannels(params);
240}
241

gpt-image-test

@CaptainJackUpdated 14 mins ago
测试 gpt image 的不同 api 能否满足图片生成要求

new-val-api-21 file match

@shouserUpdated 1 day 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