You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Bart_info.art.src%7D?q=api&page=51&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 17652 results for "api"(2318ms)
55const fetchPrompts = async () => {
56try {
57const response = await fetch("/api/mcp-prompts", {
58method: "POST",
59headers: { "Content-Type": "application/json" },
125/** Dispatch user input */
126const fireSend = async () => {
127if (!input.trim() || status !== "idle" || !config.anthropicApiKey) return;
128129const userText = input.trim();
232};
233234const canSend = input.trim() && status === "idle" && config.anthropicApiKey;
235236/* ββ UI βββββββββββββββββββββββββββββββββββββββββββββββββββββββ */
238<>
239<div className="chat-messages">
240{!config.anthropicApiKey && (
241<div className="message system">
242Please configure your Anthropic API key in settings to start chatting
243</div>
244)}
289onChange={(e) => setInput(e.target.value)}
290onKeyDown={handleKeyDown}
291placeholder={config.anthropicApiKey
292? streaming
293? "Press Enter to stop streamingβ¦"
294: "Type your messageβ¦"
295: "Configure API key in settings first"}
296className="chat-input"
297disabled={!config.anthropicApiKey || thinking}
298rows={1}
299/>
86/* Anthropic SDK instance β memoised so we don't recreate each render */
87const anthropic = React.useMemo(() => {
88if (!config.anthropicApiKey) return null;
89return new Anthropic({
90dangerouslyAllowBrowser: true,
91apiKey: config.anthropicApiKey,
92baseURL: "https://api.anthropic.com", // explicit so it works with CORS preβflights
93defaultHeaders: {
94"anthropic-version": "2023-06-01",
95// Allow calling the API directly from the browser β you accept the risk!
96"anthropic-dangerous-direct-browser-access": "true",
97},
98});
99}, [config.anthropicApiKey]);
100101/* Abort helper */
110const send = React.useCallback(
111async (history: Message[], userText: string): Promise<AssistantMsg> => {
112if (!anthropic) throw new Error("API key missing");
113if (status !== "idle") throw new Error("Stream already in progress");
114135})) as AsyncIterable<MessageStreamEvent>;
136} catch (err: any) {
137console.error("Failed to call Anthropic API", err);
138throw err;
139}