You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$1?q=fetch&page=8&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 11102 results for "fetch"(612ms)
71
72// Inject initial data to avoid extra round-trips
73const initialData = await fetchInitialData();
74const dataScript = `<script>
75window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
304async function logout(): Promise<void> {
305try {
306await fetch("/auth/logout", { method: "POST" });
307window.location.reload();
308} catch (error) {
318319try {
320const response = await fetch("/api/user/location", {
321method: "PUT",
322headers: { "Content-Type": "application/json" },
349350try {
351const response = await fetch(
352`/api/locations/search?zipCode=${
353encodeURIComponent(
428): Promise<void> {
429try {
430const response = await fetch("/api/user/location", {
431method: "PUT",
432headers: { "Content-Type": "application/json" },
482if (userData && userData.preferredLocationId) {
483try {
484const response = await fetch(
485`/api/locations/${userData.preferredLocationId}`,
486);
502async function loadGuidanceCount(): Promise<void> {
503try {
504const response = await fetch("/api/guidance");
505const guidance = await response.json();
506document.getElementById("guidance-count")!.textContent = guidance.length.toString();
512async function loadSelectionsCount(): Promise<void> {
513try {
514const response = await fetch("/api/selections");
515const selections = await response.json();
516document.getElementById("selections-count")!.textContent = selections.length.toString();