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/$%7Bart_info.art.src%7D?q=api&page=1430&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 18185 results for "api"(1604ms)

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

cabinTwitterSearchmain.tsx1 match

@jonbo•Updated 7 months ago
14}): Promise<TweetResult[]> {
15 const res = await twitterJSON({
16 url: `https://api.twitter.com/2/tweets/search/recent?query=${await searchParams(
17 {
18 query,

sqliteExplorerAppREADME.md1 match

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

@braedennorris•Updated 7 months ago
27 <head>
28 <title>SQLite Explorer</title>
29 <link rel="preconnect" href="https://fonts.googleapis.com" />
30
31 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32 <link
33 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"
34 rel="stylesheet"
35 />

github-api1 file match

@cricks_unmixed4u•Updated 56 mins ago

xxxclearinghouse_validator

@toowired•Updated 9 hours ago
Request validator for clearance API
snartapi
apiry