You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Bsuccess?q=api&page=67&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 13575 results for "api"(977ms)
302const d = { m: err.message, n: err.name, s: err.stack, t: err.type, c: err.code }; // Abbreviated error details
303log("ER", "oai", `Fail tid=${tid}`, { e: d }, mid, tid);
304throw new Error(`API fail: ${err.message}` + (err.code ? ` (Code: ${err.code})` : ""));
305}
306}
958// Original HTML generation function generateOrthogonalUI() and its embedded JS remains here.
959function generateOrthogonalUI(): string {
960return `<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>AI Biz Asst</title><script src="https://cdn.tailwindcss.com"></script><link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet"><style>
961body{font-family: 'Inter',sans-serif;overflow:hidden;background:#f3f4f6 radial-gradient(circle,rgba(0,0,0,.03) 1px,transparent 1px);background-size:10px 10px;background-attachment:fixed;transition:background-position .5s ease-out;color:#1f2937}
962#grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem;padding:1rem;max-width:900px;margin:auto;perspective:1000px;transition:opacity .5s ease-out}
122async function getDiscussionPosts(discussionId: string): Promise<PostT[]> {
123// Used to get the list of post id's for the discussion.
124const discussionRes = await fetch(`${server}/api/discussions/${discussionId}`);
125const discussionResJson = await discussionRes.json();
126134135await Promise.all(chunks.map(async (c: string[]) => {
136const postRes = await fetch(`${server}/api/posts?filter[id]=${c.join(",")}`);
137const postJson = await postRes.json();
138