You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/?q=fetch&page=4&format=json
For typeahead suggestions, use the /typeahead
endpoint:
https://codesearch.val.run/typeahead?q=fetch
Returns an array of strings in format "username" or "username/projectName"
Found 13944 results for "fetch"(1226ms)
1617const load = async () => {
18const res = await fetch("/api/todos");
19const data: Todo[] = await res.json();
20setTodos(data);
27const add = async (e: React.FormEvent) => {
28e.preventDefault();
29await fetch("/api/todos", {
30method: "POST",
31headers: { "Content-Type": "application/json" },
3738const complete = async (id: number) => {
39await fetch("/api/complete", {
40method: "POST",
41headers: { "Content-Type": "application/json" },
23}
2425// Fetch handler
26export async function GET(): Promise<Response> {
27const rows = [...db.query("SELECT id, text, last_completed_date FROM todos")]