You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/...?q=api&page=26&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 19339 results for "api"(3083ms)
299async function fetchData(endpoint) {
300try {
301const response = await fetch(`/Repository/docrepo/backend/api/${endpoint}.php`);
302if (!response.ok) throw new Error('Network response was not ok');
303return await response.json();
453// Authentication functions
454function checkAuthStatus() {
455fetch('/Repository/docrepo/backend/api/auth/session.php')
456.then(res => res.json())
457.then(data => {
480async function handleLogout() {
481try {
482const response = await fetch('/Repository/docrepo/backend/api/auth/logout.php', {
483method: 'POST',
484credentials: 'same-origin'
562563try {
564const response = await fetch('/Repository/docrepo/backend/api/auth/login.php', {
565method: 'POST',
566headers: { 'Content-Type': 'application/json' },
591592try {
593const response = await fetch('/Repository/docrepo/backend/api/auth/register.php', {
594method: 'POST',
595headers: { 'Content-Type': 'application/json' },
655
656try {
657const response = await fetch(`/Repository/docrepo/backend/api/${endpoint}.php`);
658
659if (!response.ok) {
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { useEffect, useState } from "https://esm.sh/react@18.2.0";
3import { DemoData, isApiError, isNotionPage } from "../index.tsx";
4import { GenerateHTML } from "./content/generateHTML.tsx";
5import { TOC } from "./content/demoTableOfContents.tsx";
56if (!demoData) return <div>No demo data available</div>;
5758// Handle error responses from the API
59if (isApiError(demoData)) {
60return (
61<div>
62<h3>API Response:</h3>
63<p>
64<strong>Status:</strong> {demoData.status}
146? "active"
147: ""
148} capitalize`}
149onClick={() => {
150closeMenu();
225}}
226>
227<h1 className="capitalize">
228{page.properties.Name?.title?.[0]?.plain_text ||
229"Untitled"}