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%22Image%20title%22?q=api&page=963&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 13505 results for "api"(1301ms)

modifyImageREADME.md1 match

@mrt•Updated 7 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

@mrt•Updated 7 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

@kaleidawave•Updated 7 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

@campsite•Updated 7 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

FetchBasicmain.tsx7 matches

@julesb22•Updated 7 months ago
6 headers.set("Access-Control-Allow-Headers", "Content-Type");
7
8 // Define the subscriber ID and API details
9 const subscriberId = "sub_547dbfde-2a19-452c-9f98-bc80bcdce26c";
10 const apiUrl =
11 `https://api.beehiiv.com/v2/publications/pub_0928c801-3b5c-4d00-b836-fe34ae1ef82e/subscriptions/${subscriberId}`;
12 const apiToken = "Kl51jIvL23ViixtZFqa3k78TWgKiLT8OZXBXju2gnef65Zfi0Y2cEoNTvFB6IqeS";
13
14 try {
15 // Make the API request to fetch subscriber details
16 const response = await fetch(apiUrl, {
17 method: "GET",
18 headers: {
19 "Authorization": `Bearer ${apiToken}`,
20 "Content-Type": "application/json",
21 },

FetchBasicREADME.md1 match

@julesb22•Updated 7 months ago
1# Framer Fetch: Basic
2
3A basic example of an API endpoint to use with Framer Fetch.

FetchBasic_deleted_1729503955README.md1 match

@julesb22•Updated 7 months ago
1# Framer Fetch: Basic
2
3A basic example of an API endpoint to use with Framer Fetch.

aqiREADME.md1 match

@jessicatheodosius•Updated 7 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

simpletypemain.tsx1 match

@dantaloupe•Updated 7 months ago
26 const fetchWords = useCallback(async () => {
27 try {
28 const response = await fetch("https://random-word-api.herokuapp.com/all");
29 if (!response.ok) {
30 throw new Error("Failed to fetch words");

blob_adminREADME.md1 match

@ktibow•Updated 7 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

new-val-api-demo

@shouser•Updated 10 mins ago
This is an example of using the API to create a val.

vapi-minutes-db1 file match

@henrywilliams•Updated 4 days ago
snartapi
Kapil01