You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/image-url.jpg?q=api&page=44&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 11759 results for "api"(1782ms)
112async function getDiscussionPosts(discussionId: string): Promise<PostT[]> {
113// Used to get the list of post id's for the discussion.
114const discussionRes = await fetch(`${server}/api/discussions/${discussionId}`);
115const discussionResJson = await discussionRes.json();
116124125await Promise.all(chunks.map(async (c: string[]) => {
126const postRes = await fetch(`${server}/api/posts?filter[id]=${c.join(",")}`);
127const postJson = await postRes.json();
128
20}
2122const { messages, project, branchId, anthropicApiKey, selectedFiles, images } = await c.req.json();
23// console.log("Original messages:", JSON.stringify(messages, null, 2));
24// console.log("Images received:", JSON.stringify(images, null, 2));
2526const apiKey = anthropicApiKey || Deno.env.get("ANTHROPIC_API_KEY");
27const our_api_token = apiKey === Deno.env.get("ANTHROPIC_API_KEY");
2829if (our_api_token) {
30if (await overLimit(bearerToken)) {
31return Response.json("You have reached the limit of Townie in a 24 hour period.", { status: 403 });
3637const rowid = await startTrackingUsage({
38our_api_token,
39bearerToken, // will look up the userId from this
40branch_id: branchId,
4546const anthropic = createAnthropic({
47apiKey,
48});
49