You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/image-url.jpg?q=fetch&page=17&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 10960 results for "fetch"(1281ms)
8const [error, setError] = useState(null);
910const fetchData = async () => {
11try {
12const userEndpoint = new URL(USER_ENDPOINT, window.location.origin);
1314const res = await fetch(userEndpoint);
15const data = await res.json();
16if (!res.ok) {
3334useEffect(() => {
35fetchData();
36}, []);
3738return { data, loading, error, refetch: fetchData };
39}
40
9const [error, setError] = useState(null);
1011const fetchData = async () => {
12try {
13const projectEndpoint = new URL(PROJECT_ENDPOINT, window.location.origin);
17if (branchId) filesEndpoint.searchParams.append("branchId", branchId);
1819const { project } = await fetch(projectEndpoint).then((res) =>
20res.json()
21);
22const { files } = await fetch(filesEndpoint).then((res) => res.json());
2324setData({ project, files });
34useEffect(() => {
35if (!projectId) return;
36fetchData();
37}, [projectId, branchId]);
3839return { data, loading, error, refetch: fetchData };
40}
41