You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/image-url.jpg?q=api&page=59&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 12952 results for "api"(24886ms)
9
10if (contentType.includes("application/json")) {
11// Process API request from the client-side JavaScript
12const body = await req.json();
13objective = body.objective || objective;
14
15// Make API call with the objective from the form
16const requestBody = {
17messages: [
25headers: {
26"Content-Type": "application/json",
27"Authorization": `Bearer ${Deno.env.get("AGENT_API_KEY")}`,
28},
29body: JSON.stringify(requestBody),
34}
3536// Get the API response data
37const responseData = await response.json();
38console.log("API Response:", responseData);
3940// Return JSON response for the fetch API
41return new Response(JSON.stringify({
42success: true,
53objective = formData.get("objective")?.toString() || objective;
54
55// Make API call with the objective from the form
56const requestBody = {
57messages: [
65headers: {
66"Content-Type": "application/json",
67"Authorization": `Bearer ${Deno.env.get("AGENT_API_KEY")}`,
68},
69body: JSON.stringify(requestBody),
74}
7576// Get the API response data
77const responseData = await response.json();
78console.log("API Response:", responseData);
7980// Return HTML with the results
5linkStyle default stroke:#aaaaaa,stroke-width:1.5px
6
7API[API] <--> Agent
8Chat[Chat] <--> Agent
9