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=623&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 11992 results for "api"(1181ms)

bsky_phrase_trackerREADME.md1 match

@panphora•Updated 3 months ago
72
73Built using:
74- [atproto/api](https://www.npmjs.com/package/@atproto/api) for Bluesky integration
75- [Val Town](https://val.town) for hosting and scheduling

OpenTownieREADME.md3 matches

@AIWB•Updated 3 months ago
10## Getting Started
11
121. Create a [Val Town API token](https://www.val.town/settings/api) with Val read and write permissions
132. Paste the token into the input box and get started
14
15## Forking the Project
16
17You'll need to get an **Open Router API key**.
18We choose Open Router so we could easily switch between
19all models. We soon want to make it so you can choose your
20model from a dropdown, but we're having trouble formatting the api calls such that they work on all providers. Maybe we need to switch to the vercel sdk

OpenTowniesystem_prompt.txt2 matches

@AIWB•Updated 3 months ago
26 * DO NOT use the alert(), prompt(), or confirm() methods.
27
28 * If the user's app needs weather data, use open-meteo unless otherwise specified because it doesn't require any API keys.
29
30 * Tastefully add a view source link back to the user's val if there's a natural spot for it. Generate the val source url via `import.meta.url.replace("esm.town", "val.town")`. This link element should include a target="_top" attribute.
38 Val Town's client-side catch script automatically catches client-side errors to aid in debugging.
39
40 * Don't use any environment variables unless strictly necessary. For example use APIs that don't require a key.
41 If you need environment variables use `Deno.env.get('keyname')`
42

OpenTowniegenerateCode2 matches

@AIWB•Updated 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);

ThumbMakermain.tsx1 match

@AIWB•Updated 3 months ago
2 * This application creates a thumbnail maker using Hono for server-side routing and client-side JavaScript for image processing.
3 * It allows users to upload images, specify output options, and generate a composite thumbnail image.
4 * The app uses the HTML5 Canvas API for image manipulation and supports drag-and-drop functionality.
5 *
6 * The process is divided into two steps:

createWebsitemain.tsx5 matches

@Mostafa3135•Updated 3 months ago
4
5// Utility Functions
6const API_BASE_URL = 'https://api.example.com';
7
8// Components
68 e.preventDefault();
69 try {
70 const response = await fetch(`${API_BASE_URL}/login`, {
71 method: 'POST',
72 headers: { 'Content-Type': 'application/json' },
121
122 try {
123 const response = await fetch(`${API_BASE_URL}/signup`, {
124 method: 'POST',
125 headers: { 'Content-Type': 'application/json' },
181
182 try {
183 const response = await fetch(`${API_BASE_URL}/upload`, {
184 method: 'POST',
185 body: formData
215
216 try {
217 const response = await fetch(`${API_BASE_URL}/chat`, {
218 method: 'POST',
219 headers: { 'Content-Type': 'application/json' },

competentOlivePeacockmain.tsx9 matches

@awhitter•Updated 3 months ago
58 const fetchContent = async () => {
59 try {
60 const response = await fetch("/api/content");
61 const data = await response.json();
62 if (data.records) {
99 const analyzeContent = async (item: AirtableRecord) => {
100 try {
101 const response = await fetch("/api/analyze", {
102 method: "POST",
103 headers: {
238 const url = new URL(req.url);
239
240 if (url.pathname === "/api/content") {
241 const apiToken = Deno.env.get("VITE_AIRTABLE_API_KEY");
242 const baseId = Deno.env.get("VITE_AIRTABLE_BASE_ID");
243 const tableId = Deno.env.get("VITE_AIRTABLE_TABLE_ID");
244
245 if (!apiToken || !baseId || !tableId) {
246 return new Response(JSON.stringify({ error: "Missing environment variables" }), {
247 status: 500,
250 }
251
252 const airtableUrl = `https://api.airtable.com/v0/${baseId}/${tableId}`;
253
254 const headers = new Headers({
255 "Authorization": `Bearer ${apiToken}`,
256 "Content-Type": "application/json",
257 "Access-Control-Allow-Origin": "*",
267 const response = await fetch(airtableUrl, {
268 headers: {
269 "Authorization": `Bearer ${apiToken}`,
270 "Content-Type": "application/json",
271 },
285 });
286 }
287 } else if (url.pathname === "/api/analyze") {
288 if (req.method === "POST") {
289 const { OpenAI } = await import("https://esm.town/v/std/openai");

githubParsermain.tsx16 matches

@yawnxyz•Updated 3 months ago
96 <h1>GitHub Repository Parser</h1>
97 <p class="pb-4">Parse and analyze GitHub repositories.</p>
98 <p class="pb-4">Sometimes GitHub will block your request (e.g. respond with "forbidden"), in which case you'll just have to try again later. Or clone this project and use your own API key ;)</p>
99 <form id="repoForm" class="mb-4">
100 <input type="text" id="repoUrl" value="https://github.com/elder-plinius/L1B3RT45" placeholder="Enter GitHub repository URL"
589async function fetchRepositoryContent(owner, repo, specifiedBranch = null, ignoredPatterns, selectedTypes = null) {
590 // First, try to get the default branch or use the specified branch
591 const repoInfoUrl = `https://api.github.com/repos/${owner}/${repo}`;
592 const repoInfoResponse = await fetch(repoInfoUrl, {
593 headers: {
594 'Authorization': `token ${Deno.env.get("GITHUB_API_KEY")}`,
595 'Accept': 'application/vnd.github.v3+json'
596 }
607 const defaultBranch = specifiedBranch || repoInfo.default_branch;
608
609 const apiUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${defaultBranch}?recursive=1`;
610 const response = await fetch(apiUrl, {
611 headers: {
612 'Authorization': `token ${Deno.env.get("GITHUB_API_KEY")}`,
613 'Accept': 'application/vnd.github.v3+json'
614 }
619 throw new Error(`Failed to fetch repository content. The ${defaultBranch} branch might not exist.`);
620 }
621 throw new Error(`GitHub API request failed: ${response.statusText}`);
622 }
623
662
663async function fetchFileContent(owner, repo, path, branch) {
664 const apiUrl = `https://api.github.com/repos/${owner}/${repo}/contents/${path}`;
665 const response = await fetch(apiUrl, {
666 headers: {
667 'Authorization': `token ${Deno.env.get("GITHUB_API_KEY")}`,
668 'Accept': 'application/vnd.github.v3+json'
669 }
821// Add new function to get repository file types
822async function getRepositoryFileTypes(owner, repo, specifiedBranch = null) {
823 const repoInfoUrl = `https://api.github.com/repos/${owner}/${repo}`;
824 const repoInfoResponse = await fetch(repoInfoUrl, {
825 headers: {
826 'Authorization': `token ${Deno.env.get("GITHUB_API_KEY")}`,
827 'Accept': 'application/vnd.github.v3+json'
828 }
836 const defaultBranch = specifiedBranch || repoInfo.default_branch;
837
838 const apiUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${defaultBranch}?recursive=1`;
839 const response = await fetch(apiUrl, {
840 headers: {
841 'Authorization': `token ${Deno.env.get("GITHUB_API_KEY")}`,
842 'Accept': 'application/vnd.github.v3+json'
843 }
845
846 if (!response.ok) {
847 throw new Error(`GitHub API request failed: ${response.statusText}`);
848 }
849

r1main.tsx8 matches

@sboesen•Updated 3 months ago
6// main controller function
7export default async function(receivedEmail) {
8 const apiKey = Deno.env.get("FIREWORKS_API_KEY");
9 const model = "accounts/fireworks/models/deepseek-r1";
10
11 if (!apiKey) {
12 throw new Error(
13 "FIREWORKS_API_KEY environment variable is not set. Please set it or replace this line with your API key.",
14 );
15 }
37
38 // step 4: send prompt to Fireworks.ai
39 const aiResponse = await sendRequestToFireworks(prompt, apiKey, model);
40
41 // step 5: parse the AI response
132
133// helper function to send a request to Fireworks.ai
134async function sendRequestToFireworks(prompt, apiKey, model) {
135 try {
136 const client = new OpenAI({
137 baseURL: "https://api.fireworks.ai/inference/v1",
138 apiKey: apiKey,
139 });
140
160 return message;
161 } catch (error) {
162 console.error("Fireworks.ai API Error:", error);
163 return `Error: ${error.message}`;
164 }

appmain.tsx2 matches

@RIKKAEBI•Updated 3 months ago
92 <title>RIKKAEBI</title>
93 <script src="https://cdn.tailwindcss.com"></script>
94 <link rel="preconnect" href="https://fonts.googleapis.com">
95 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
96 <link href="https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap" rel="stylesheet">
97 <meta name="viewport" content="width=device-width, initial-scale=1">
98 </head>

social_data_api_project3 file matches

@tsuchi_ya•Updated 16 hours ago

simple-scrabble-api1 file match

@bry•Updated 3 days ago
apiv1
papimark21