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/$2?q=api&page=48&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 18287 results for "api"(3919ms)

markdown-embedApp.tsx5 matches

@stevekrouseUpdated 3 days ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { useEffect, useState } from "https://esm.sh/react@18.2.0";
3import { DemoData, isApiError, isNotionPage } from "../index.tsx";
4import { CheckoutContent } from "./content/checkout/checkout.tsx";
5import { FormContent } from "./content/form/form.tsx";
60 if (!demoData) return <div>No demo data available</div>;
61
62 // Handle error responses from the API
63 if (isApiError(demoData)) {
64 return (
65 <div>
66 <h3>API Response:</h3>
67 <p>
68 <strong>Status:</strong> {demoData.status}
168 href={`#${page.properties.Name.title[0].plain_text}`}
169 className={
170 `${currentHash === page.properties.Name.title[0].plain_text ? 'active' : ''} capitalize`
171 }
172 onClick={() => {

markdown-embedapi.ts0 matches

@stevekrouseUpdated 3 days ago
1import { Hono } from "npm:hono";
2
3// Import route modules
4import cobrowse from "./cobrowse.ts";
5import database from "./database.ts";

osverify10 matches

@dinavinterUpdated 3 days ago
2
3const GIGYA_DOMAIN = process.env.GIGYA_DOMAIN || "accounts.eu1.gigya.com";
4const GIGYA_API_KEY = process.env.GIGYA_API_KEY;
5const GIGYA_APP_KEY = process.env.GIGYA_APP_KEY;
6const GIGYA_APP_SECRET = process.env.GIGYA_APP_SECRET;
7
8if (!GIGYA_API_KEY || !GIGYA_APP_KEY || !GIGYA_APP_SECRET) {
9 console.error("Missing Gigya environment variables!");
10 console.log("Required variables: GIGYA_API_KEY, GIGYA_APP_KEY, GIGYA_APP_SECRET");
11 process.exit(1);
12}
16
17 const body = new URLSearchParams({
18 apiKey: GIGYA_API_KEY,
19 userKey: GIGYA_APP_KEY,
20 secret: GIGYA_APP_SECRET,
123 }
124
125 // 5. Test connection to accounts API
126 console.log("\n5. Testing accounts API connection...");
127 try {
128 const testResponse = await makeGigyaRequest("accounts.getAccountInfo", {
130 });
131
132 // We expect this to fail with "user not found" which means the API is working
133 if (testResponse.errorCode === 403005) {
134 console.log("✅ Accounts API connection working (user not found as expected)");
135 } else {
136 console.log(`⚠️ Unexpected accounts API response: ${testResponse.errorMessage}`);
137 }
138 } catch (error) {
139 console.log("❌ Accounts API connection failed:", error.message);
140 }
141

osds-schema.ts4 matches

@dinavinterUpdated 3 days ago
2
3const GIGYA_DOMAIN = process.env.GIGYA_DOMAIN || "accounts.eu1.gigya.com";
4const GIGYA_API_KEY = process.env.GIGYA_API_KEY;
5const GIGYA_APP_KEY = process.env.GIGYA_APP_KEY;
6const GIGYA_APP_SECRET = process.env.GIGYA_APP_SECRET;
7
8if (!GIGYA_API_KEY || !GIGYA_APP_KEY || !GIGYA_APP_SECRET) {
9 console.error("Missing Gigya environment variables!");
10 console.log("Required variables: GIGYA_API_KEY, GIGYA_APP_KEY, GIGYA_APP_SECRET");
11 process.exit(1);
12}
16
17 const body = new URLSearchParams({
18 apiKey: GIGYA_API_KEY,
19 userKey: GIGYA_APP_KEY,
20 secret: GIGYA_APP_SECRET,

FarcasterSpacesSpace.tsx2 matches

@moeUpdated 3 days ago
139
140 const queryFn = () =>
141 fetch(`/api/channels`)
142 .then((r) => r.json())
143 .then((r) => r?.data?.channels?.find((c) => c.channel_name == channel))
146
147 const join = async () => {
148 const response = await fetch(`/api/token?channel=${channel}&uid=${uid}`).then((r) => r.json())
149 console.log('response', response)
150 setToken(response.token)

utilsREADME.md1 match

@stdUpdated 3 days ago
1# Val Town Project Utilities
2
3These utils are very rapidly developing, so expect breaking changes.
4
5* file - reading files and directories in Projects

GlancerApp.tsx5 matches

@lightweightUpdated 3 days ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { useEffect, useState } from "https://esm.sh/react@18.2.0";
3import { DemoData, isApiError, isNotionPage } from "../index.tsx";
4import { CheckoutContent } from "./content/checkout/checkout.tsx";
5import { FormContent } from "./content/form/form.tsx";
60 if (!demoData) return <div>No demo data available</div>;
61
62 // Handle error responses from the API
63 if (isApiError(demoData)) {
64 return (
65 <div>
66 <h3>API Response:</h3>
67 <p>
68 <strong>Status:</strong> {demoData.status}
168 href={`#${page.properties.Name.title[0].plain_text}`}
169 className={
170 `${currentHash === page.properties.Name.title[0].plain_text ? 'active' : ''} capitalize`
171 }
172 onClick={() => {
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7

Glancerdemo.ts5 matches

@lightweightUpdated 3 days ago
5} from "https://esm.town/v/std/utils/index.ts";
6import { Hono } from "npm:hono";
7import { examplePDF } from "../../api/servePDF.ts";
8import { getPage } from "../../../controllers/getPage.ts";
9import { getRelatedPagesFromDatabase } from "../../../controllers/getRelatedPagesFromDatabase.ts";
27 let html = await readFile("/frontend/index.html", import.meta.url);
28
29 // Use the /demo API endpoint to get data
30 // const apiUrl = new URL(c.req.url);
31 // apiUrl.pathname = `/api/demo/${id}`;
32 // const response = await fetch(apiUrl.toString());
33 const page = await getPage(id);
34

my-first-valindex.tsx1 match

@OnujulesUpdated 3 days ago
10 <link rel="stylesheet" href="https://esm.town/v/Onujules/my-first-val@main/frontend/style.css" />
11 <style>
12 @import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700&display=swap');
13
14 body {

github-api1 file match

@cricks_unmixed4uUpdated 18 hours ago

beeminder-api4 file matches

@cricks_unmixed4uUpdated 19 hours ago
Kapil01
apiv1