You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/...?q=openai&page=6&format=json
For typeahead suggestions, use the /typeahead
endpoint:
https://codesearch.val.run/typeahead?q=openai
Returns an array of strings in format "username" or "username/projectName"
Found 2231 results for "openai"(2685ms)
1import { OpenAI } from "https://esm.town/v/std/openai";
23// --- TYPE DEFINITIONS ---
420421export default async function(req: Request): Promise<Response> {
422const openai = new OpenAI();
423const url = new URL(req.url);
424const CORS_HEADERS = {
459}
460461const completion = await openai.chat.completions.create({
462model,
463messages: [{ role: "system", content: prompt }, { role: "user", content: userContent }],
1import { OpenAI } from "https://esm.town/v/std/openai";
23// --- TYPE DEFINITIONS ---
372373export default async function(req: Request): Promise<Response> {
374const openai = new OpenAI();
375const url = new URL(req.url);
376const CORS_HEADERS = {
411}
412413const completion = await openai.chat.completions.create({
414model,
415messages: [{ role: "system", content: prompt }, { role: "user", content: userContent }],