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=629&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 12013 results for "api"(1062ms)

cerebrasTemplateREADME.md6 matches

@h123Updated 3 months ago
22
231. Sign up for [Cerebras](https://cloud.cerebras.ai/)
242. Get a Cerebras API Key
253. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`
26
27Once Cerebras is set up in your Val Town account, there are two ways to get started:
37const { OpenAI } = await import("https://esm.sh/openai");
38const client = new OpenAI({
39 apiKey: Deno.env.get("CEREBRAS_API_KEY"),
40 baseURL: "https://api.cerebras.ai/v1"
41});
42const response = await client.chat.completions.create({
54## Sample apps
55
56* **[Cerebras Searcher](https://www.val.town/v/stevekrouse/cerebras_searcher)** - a Perplexity clone that uses the SerpAPI to do RAG
57and summaries with Cerebras (*requires a SerpAPI key*)
58* **[Cerebras Coder](https://www.val.town/v/stevekrouse/cerebras_coder)** - an app that
59generates websites in a second with Cerebras

cerebrasTemplatemain.tsx5 matches

@h123Updated 3 months ago
88 // Keep these comments so we remember not to change this
89 const client = new OpenAI({
90 apiKey: Deno.env.get("CEREBRAS_API_KEY"),
91 baseURL: "https://api.cerebras.ai/v1",
92 });
93
101 return Response.json({ message: generatedMessage });
102 } catch (error) {
103 console.error("Error calling Cerebras API:", error);
104
105 if (error.status === 429) {
106 return Response.json({ error: "Cerebras API rate limit reached. Please try again later." }, { status: 429 });
107 } else {
108 return Response.json({ error: `API Error: ${error.message}` }, { status: 500 });
109 }
110 }

cerebras_coderREADME.md2 matches

@h123Updated 3 months ago
6
71. Sign up for [Cerebras](https://cloud.cerebras.ai/)
82. Get a Cerebras API Key
93. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`

cerebras_codermain.tsx5 matches

@h123Updated 3 months ago
212 } catch (error) {
213 Toastify({
214 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
215 position: "center",
216 duration: 3000,
1024 };
1025 } else {
1026 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1027 const completion = await client.chat.completions.create({
1028 messages: [
1149 <meta name="viewport" content="width=device-width, initial-scale=1.0">
1150 <title>CerebrasCoder</title>
1151 <link rel="preconnect" href="https://fonts.googleapis.com" />
1152 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1153 <link
1154 href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
1155 rel="stylesheet"
1156 />
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1168
1169

karate_classesmain.tsx19 matches

@stevekrouseUpdated 3 months ago
97
98 useEffect(() => {
99 fetch("/api/classes")
100 .then(res => res.json())
101 .then(data => {
133 useEffect(() => {
134 console.log("Fetching class details for ID:", id);
135 fetch(`/api/classes/${id}`)
136 .then(res => res.json())
137 .then(data => {
143 if (email) {
144 console.log("Checking registration status for email:", email);
145 fetch(`/api/classes/${id}/registration?email=${email}`)
146 .then(res => res.json())
147 .then(data => {
156
157 const handleRegister = () => {
158 fetch(`/api/classes/${id}/register`, {
159 method: "POST",
160 headers: { "Content-Type": "application/json" },
174
175 const handleCancel = () => {
176 fetch(`/api/classes/${id}/cancel`, {
177 method: "POST",
178 headers: { "Content-Type": "application/json" },
193 const handleDelete = () => {
194 if (window.confirm("Are you sure you want to delete this class?")) {
195 fetch(`/api/classes/${id}`, { method: "DELETE" })
196 .then(() => navigate("/classes"))
197 .catch(error => console.error("Error deleting class:", error));
266 useEffect(() => {
267 if (id) {
268 fetch(`/api/classes/${id}`)
269 .then(res => res.json())
270 .then(data => {
289
290 const method = id ? "PUT" : "POST";
291 const url = id ? `/api/classes/${id}` : "/api/classes";
292
293 fetch(url, {
415 const emailList = emails.split(/[\s,]+/).filter(email => email.trim() !== "");
416
417 fetch(`/api/classes/${id}/bulk-add`, {
418 method: "POST",
419 headers: { "Content-Type": "application/json" },
470const app = new Hono();
471
472app.get("/api/classes", async (c) => {
473 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
474 const KEY = "karate_classes";
484});
485
486app.get("/api/classes/:id", async (c) => {
487 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
488 const KEY = "karate_classes";
507});
508
509app.post("/api/classes", async (c) => {
510 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
511 const KEY = "karate_classes";
527});
528
529app.put("/api/classes/:id", async (c) => {
530 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
531 const KEY = "karate_classes";
548});
549
550app.delete("/api/classes/:id", async (c) => {
551 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
552 const KEY = "karate_classes";
563});
564
565app.post("/api/classes/:id/register", async (c) => {
566 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
567 const KEY = "karate_classes";
603});
604
605app.post("/api/classes/:id/cancel", async (c) => {
606 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
607 const KEY = "karate_classes";
628});
629
630app.get("/api/classes/:id/registration", async (c) => {
631 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
632 const KEY = "karate_classes";
651});
652
653app.post("/api/classes/:id/bulk-add", async (c) => {
654 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
655 const KEY = "karate_classes";
737 const isAdmin = email && ADMIN_EMAILS.includes(email);
738
739 if (url.pathname.startsWith("/api")) {
740 return app.fetch(request);
741 }

subtleAmaranthWaspmain.tsx1 match

@gigmxUpdated 3 months ago
59
60 const connectWebSocket = useCallback(() => {
61 const ws = new WebSocket("wss://pumpportal.fun/api/data");
62
63 ws.onopen = () => {

OpenTowniegenerateCode.ts2 matches

@pomdtrUpdated 3 months ago
29
30 const openai = new OpenAI({
31 baseURL: "https://openrouter.ai/api/v1",
32 apiKey: Deno.env.get("OPEN_ROUTER_KEY"),
33 });
34 console.log(messages);

twitterAlertREADME.md4 matches

@rbmUpdated 3 months ago
31Refer to [Twitter's search operators](https://socialdata.gitbook.io/docs/twitter-tweets/retrieve-search-results-by-keyword#endpoint-parameters) to fine-tune your query.
32
33### 4. Test API call
34Set `isProd = false` in the code if you are testing, to ensure there are enough tweets to display. <br>
35Toggle it back to `true` when you're ready to run this cron job in production and actuall send notifications.
60
61### NOTE: Usage Limits
62This val uses the SocialData API for Twitter data:
63
64- **Proxies via Val Town's [SocialDataProxy](https://www.val.town/v/stevekrouse/socialDataProxy)**: Limited to 10 cents per day for [**Val Town Pro users**](https://www.val.town/pricing). This API is *only* for Pro users.
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.

cerebras_coderREADME.md2 matches

@javigropUpdated 3 months ago
6
71. Sign up for [Cerebras](https://cloud.cerebras.ai/)
82. Get a Cerebras API Key
93. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`

cerebras_codermain.tsx5 matches

@javigropUpdated 3 months ago
212 } catch (error) {
213 Toastify({
214 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
215 position: "center",
216 duration: 3000,
1024 };
1025 } else {
1026 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1027 const completion = await client.chat.completions.create({
1028 messages: [
1149 <meta name="viewport" content="width=device-width, initial-scale=1.0">
1150 <title>CerebrasCoder</title>
1151 <link rel="preconnect" href="https://fonts.googleapis.com" />
1152 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1153 <link
1154 href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
1155 rel="stylesheet"
1156 />
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1168
1169

social_data_api_project3 file matches

@tsuchi_yaUpdated 7 hours ago

simple-scrabble-api1 file match

@bryUpdated 3 days 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