You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/...?q=api&page=31&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 19334 results for "api"(1293ms)
34const anthropic = new Anthropic({
5apiKey: Deno.env.get("ANTHROPIC_API_KEY"),
6});
7
1import { sqlite } from "https://esm.town/v/std/sqlite";
23const API_KEY = Deno.env.get("API_KEY");
45export default async function httpHandler(req: Request): Promise<Response> {
6if (!validateApiKey(req)) {
7return new Response("Unauthorized", { status: 401 });
8}
72}
7374function validateApiKey(req: Request): boolean {
75const authHeader = req.headers.get("Authorization");
76return authHeader === `Bearer ${API_KEY}`;
77}
78