You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/image-url.jpg%20%22Optional%20title%22?q=fetch&page=1&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 8212 results for "fetch"(1132ms)
36});
3738export default app.fetch;
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import ValTown from "npm:@valtown/sdk";
430// Example of using the API to create a new val with a single file
31// First create the val
32const valResponse = await fetch(
33`${API_URL}/v2/vals`,
34{
52// Then create the file
53const val = await valResponse.json();
54const fileResponse = await fetch(
55`${API_URL}/v2/vals/${val.id}/files?path=main.tsx`,
56{