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/$%7Burl%7D?q=api&page=1343&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 19255 results for "api"(3796ms)

APITemplateWithSwaggerUIREADME.md1 match

@dcm31•Updated 4 months ago
1# APITemplateWithSwaggerUI

blueskyBotTutorialREADME.md1 match

@charmaine•Updated 4 months ago
1# Bluesky Bot Tutorial
2
3*_This template shows you how to use the Bluesky API to make a bot. This starter template was ported from [this one on Docs](https://docs.bsky.app/docs/starter-templates/bots)._*
4
5## To run it:

cerebrasTemplateREADME.md6 matches

@charmaine•Updated 4 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

@charmaine•Updated 4 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 }

respectableCoralLimpetREADME.md5 matches

@charmaine•Updated 4 months ago
1# Gemini API
2A simple and easy to use client for the Gemini API
3
4*_This template shows you how to use the Gemini. This starter template was ported from [this one on Docs](https://ai.google.dev/gemini-api/docs/quickstart?lang=node#install-gemini-library)._*
5
6## To run it:
7
8- Click `Fork` on this val
9- Get your [Gemini API key](https://aistudio.google.com/app/apikey)
10- Add it to your [Environment Variables](https://www.val.town/settings/environment-variables) as `GEMINI_API_KEY`
11- Click `Run` on this script val

respectableCoralLimpetmain.tsx1 match

@charmaine•Updated 4 months ago
1import { GoogleGenerativeAI } from "npm:@google/generative-ai";
2
3const genAI = new GoogleGenerativeAI(Deno.env.get("GEMINI_API_KEY"));
4const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash" });
5

googleGeminiAPImain.tsx1 match

@charmaine•Updated 4 months ago
1import { GoogleGenerativeAI } from "npm:@google/generative-ai";
2
3const genAI = new GoogleGenerativeAI(Deno.env.get("GEMINI_API_KEY"));
4const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash" });
5

listNotionUsersREADME.md2 matches

@charmaine•Updated 4 months ago
1# Notion SDK for JavaScript
2A simple and easy to use client for the Notion API
3
4*_This template shows you how to use the Notion SDK. This starter template was ported from [this one on GitHub](https://github.com/makenotion/notion-sdk-js?tab=readme-ov-file#installation)._*
7
8- Click `Fork` on this val
9- Get your Notion API key at https://www.notion.so/profile/integrations
10- Add it to your [Environment Variables](https://www.val.town/settings/environment-variables) as `NOTION_TOKEN`
11- Click `Run` on this script val

windsurf_projectContextmain.tsx5 matches

@toowired•Updated 4 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5// API Documentation
6/**
7 * @typedef {Object} ProjectState
67 setError(null);
68 try {
69 const response = await fetch("/api/state");
70 if (!response.ok) throw new Error("Failed to fetch state");
71 const data = await response.json();
86 setError(null);
87 try {
88 const response = await fetch("/api/state", {
89 method: "POST",
90 headers: { "Content-Type": "application/json" },
558
559 try {
560 if (req.method === "GET" && req.url.endsWith("/api/state")) {
561 const state = await getState();
562 return Response.json(state || {
567 recentChanges: []
568 });
569 } else if (req.method === "POST" && req.url.endsWith("/api/state")) {
570 const update = await req.json();
571 validateInput(update);

BraintrustSDKtutorial1 match

@stevekrouse•Updated 4 months ago
5export default async function handler() {
6 const result = {
7 apiKeyStatus: null,
8 evalStarted: false,
9 evalComplete: false,
Plantfo

Plantfo8 file matches

@Llad•Updated 2 hours ago
API for AI plant info

api_ianmenethil_com133 file matches

@ianmenethil•Updated 11 hours ago
apiry
snartapi