You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/...?q=api&page=43&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 19273 results for "api"(3088ms)
33/* 2. HTTP handler */
34export default async function(req: Request) {
35/* 2-a â–¸ fetch latest news (your micro-API) ----------------------- */
36const allNews: any[] = await fetch("https://samxii777--38a891a64b5911f094ef76b3cceeab13.web.val.run/latest?limit=20")
37.then(r => r.json())
3import { createClient } from "npm:@supabase/supabase-js";
4import RSSParser from "npm:rss-parser";
5import { TwitterApi } from "npm:twitter-api-v2";
67// Feeds content (can stay outside as it doesn't depend on val.secrets)
6869// Twitter Client - MUST be inside this function or a function called by it
70const client = new TwitterApi({
71appKey: val.secrets.TWITTER_APP_KEY,
72appSecret: val.secrets.TWITTER_APP_SECRET,