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=api&page=39&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 11852 results for "api"(686ms)
12app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
1314// Add your API routes here
15// app.get("/api/data", c => c.json({ hello: "world" }));
1617// Unwrap and rethrow Hono errors as the original error
192193// Add engagement filters
194// Note: Some of these filters might need adjustment based on SocialData API's exact syntax
195if (likesCount) {
196finalQuery += ` min_faves:${likesCount}`;
197// The API might not directly support "less than" for likes, this would need to be filtered client-side
198}
199204205// Note: Replies count, bookmark count, and views count might not be directly filterable
206// in the Twitter/X API. These may need to be filtered client-side after fetching.
207208return finalQuery.trim();
241cursor,
242filters: {
243// These filters will be applied client-side if the API doesn't support them directly
244repliesCount: repliesCount ? { value: parseInt(repliesCount), direction: repliesDirection } : null,
245bookmarksCount: bookmarksCount ? { value: parseInt(bookmarksCount), direction: bookmarksDirection } : null,
321// Helper to check if a tweet meets the client-side filter criteria
322const meetsCriteria = (tweet) => {
323// Apply any client-side filters here that the API doesn't support
324325// Reply count filter
344}
345346// Apply like count filter if not handled by API
347if (likesCount && likesDirection === "lt" && tweet.favorite_count !== undefined) {
348if (tweet.favorite_count >= parseInt(likesCount)) return false;
349}
350351// Apply retweet count filter if not handled by API
352if (retweetsCount && retweetsDirection === "lt" && tweet.retweet_count !== undefined) {
353if (tweet.retweet_count >= parseInt(retweetsCount)) return false;
1039rel: "noopener noreferrer",
1040},
1041"SocialData API",
1042),
1043" | ",