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/$%7Bsuccess?q=api&page=953&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 12844 results for "api"(2136ms)

emailREADME.md1 match

@shouserUpdated 8 months ago
54You can attach files to your emails by using the `attachments` field.
55Attachments need to be [Base64](https://en.wikipedia.org/wiki/Base64) encoded,
56which is that the [btoa](https://developer.mozilla.org/en-US/docs/Web/API/btoa)
57method is doing in this example:
58

emailmain.tsx2 matches

@shouserUpdated 8 months ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { parseSendGridEmail } from "https://esm.town/v/stevekrouse/parseSendGridEmail?v=8";
3import { parseSendGridEmails } from "https://esm.town/v/stevekrouse/parseSendGridEmails?v=10";
69}) => {
70 let result = await fetch(
71 `${API_URL}/v1/email`,
72 {
73 method: "POST",

reluctantCoffeeGayalmain.tsx9 matches

@kazUpdated 8 months ago
49 const fetchAnswersAndRankings = async () => {
50 if (user) {
51 const response = await fetch("/api/answers");
52 const data = await response.json();
53 setAnswers(data.answers);
59 const saveAnswer = useCallback(async (newAnswer: Answer, losingAnswer: string) => {
60 if (user) {
61 await fetch("/api/answer", {
62 method: "POST",
63 headers: { "Content-Type": "application/json" },
70 const clearAnswers = useCallback(async () => {
71 if (user) {
72 await fetch("/api/clear-answers", { method: "POST" });
73 setAnswers([]);
74 setRankings([]);
242 const handleLogin = useCallback(async (e: React.FormEvent) => {
243 e.preventDefault();
244 const response = await fetch("/api/login", {
245 method: "POST",
246 headers: { "Content-Type": "application/json" },
314
315 const url = new URL(request.url);
316 if (url.pathname === "/api/login") {
317 const { username } = await request.json();
318 await sqlite.execute(`INSERT OR IGNORE INTO ${KEY}_users (username) VALUES (?)`, [username]);
321 }
322
323 if (url.pathname === "/api/answer") {
324 const { questionId, answer, losingAnswer } = await request.json();
325 const userId = 1; // In a real app, you'd get this from the session
333 }
334
335 if (url.pathname === "/api/answers") {
336 const userId = 1; // In a real app, you'd get this from the session
337 const answers = (await sqlite.execute(`SELECT * FROM ${KEY}_answers WHERE user_id = ?`, [userId])).rows;
340 }
341
342 if (url.pathname === "/api/clear-answers") {
343 const userId = 1; // In a real app, you'd get this from the session
344 await sqlite.execute(`DELETE FROM ${KEY}_answers WHERE user_id = ?`, [userId]);
411
412const css = `
413 @import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Roboto:wght@300;400;500&display=swap');
414
415 :root {

fancyPlumSquirrelmain.tsx2 matches

@cofsanaUpdated 8 months ago
1/**
2 * This val creates an elegant and professional web app for managing panel members for the State Street discussion.
3 * It uses React for the UI, SQLite for storing panel member information, and the Fetch API to communicate with the server.
4 * The design is clean and sophisticated, with a muted color palette and subtle animations.
5 */
182
183const css = `
184 @import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Roboto:wght@300;400;700&display=swap');
185
186 :root {

masterPancakeCheckermain.tsx2 matches

@bpughUpdated 8 months ago
6import { email } from "https://esm.town/v/std/email";
7
8const THEATER_API = "https://drafthouse.com/s/mother/v2/schedule/collection/austin/master-pancake";
9const STORAGE_KEY = "alamo_showings";
10
11async function fetchShowings() {
12 const response = await fetch(THEATER_API);
13 return await response.json();
14}

AlgoliaRecordSender2main.tsx4 matches

@willthereaderUpdated 8 months ago
1// Importing environment variables
2const ALGOLIA_APP_ID = Deno.env.get("ALGOLIA_APP_ID");
3const ALGOLIA_WRITE_API_KEY = Deno.env.get("ALGOLIA_WRITE_API_KEY");
4const ALGOLIA_INDEX_NAME = "Test_index";
5
227 "chapterTitle": "A Side Ws",
228 "chapterNumber": 1,
229 "content": "If Hitler were president she'd have to obey him. Someone forced her to put people in the Birdcage when she didn't want to, but other times left her orders vague and unclear? Gave her loopholes? Who had legal authority over Dragon? \"You don't have to ask stupid questions,\" Forecast suggested. \"You're smart enough to figure out what was going on. Why Dragon was afraid of being used. Why Taylor and Veda were working with Armsmaster to set her free.\" She paused, a hiss escaping her breath from wherever she was. \"No one deserves to be a slave, to be used for what they are with no care for who they are.\" The PRT. No, the Triumvirate. \"You're saying Alexandria knew.\" Forecast didn't answer at first. She waited a second and then another. \"You don't need me to answer that,\" she stated confidently. \"They were trying to free her?\" Halberd asked. \"Break the restrictions?\" \"Yes. The only problem was the Dragonslayers.",
230 "startIndex": 378,
231 "endIndex": 398,
491 "chapterTitle": "A Side Ws",
492 "chapterNumber": 1,
493 "content": "Chambers downed his drink rapidly. \"Well. Good luck with that, but I'll warn you now that no one likes watching criminals go free, even if they have a sad story.\" \"I do not need to find a way to let them out,\" Veda declared. \"I already possess one.\" \"You can't do that,\" Banks snapped. \"You don't have the—\" \"Newtype is presently in the process of releasing Jillian Monroe, Thomas Heyworth, Cecil Nunyez, and Veronica Lyod from confinement. We will be returning them home this afternoon.\" Eyes widened and more shouts started to fill the room. Kamil settled into his seat, thinking. \"I trust that the PRT will respect that all four of these individuals are definitively innocent of the crimes that put them in the Birdcage.\" That was a warning. \"How?\" Seneca asked, her voice making it through all the others. \"How are you getting them out?\" \"Through the Birdcage's own inbuilt systems… You are unaware of this?\" Kamil raised his brow again. \"You're saying that there is a way out of the Birdcage? It's part of the prison itself?\" \"It is. I have access to several detailed requests Dragon made to the PRT.",
494 "startIndex": 840,
495 "endIndex": 860,
662 const headers = {
663 "Content-Type": "application/json",
664 "X-Algolia-API-Key": ALGOLIA_WRITE_API_KEY,
665 "X-Algolia-Application-Id": ALGOLIA_APP_ID,
666 };

egoBoostermain.tsx2 matches

@stevekrouseUpdated 8 months ago
2 * This ego booster app takes a selfie, sends it to GPT-4o-mini for analysis,
3 * and streams funny, specific compliments about the user's appearance.
4 * We use the WebRTC API for camera access, the OpenAI API for image analysis,
5 * and server-sent events for real-time streaming of compliments.
6 */
259
260const css = `
261 @import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Poppins:wght@400;600&display=swap');
262
263 body {

lovelyBeigeSolemain.tsx1 match

@megladoUpdated 8 months ago
96 const data = await response;
97 const update = await fetch(
98 `https://discord.com/api/v10/webhooks/${body.application_id}/${body.token}/messages/@original`,
99 {
100 method: "PATCH",

discordBotmain.tsx1 match

@megladoUpdated 8 months ago
96 const data = await response;
97 const update = await fetch(
98 `https://discord.com/api/v10/webhooks/${body.application_id}/${body.token}/messages/@original`,
99 {
100 method: "PATCH",

password_authREADME.md1 match

@cofsanaUpdated 8 months ago
19```
20
21If you want to use an [api token](https://www.val.town/settings/api) to authenticate:
22
23```ts

vapi-minutes-db1 file match

@henrywilliamsUpdated 1 day ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 1 day ago
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