You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Burl%7D?q=image&page=8&format=json
For typeahead suggestions, use the /typeahead
endpoint:
https://codesearch.val.run/typeahead?q=image
Returns an array of strings in format "username" or "username/projectName"
Found 6339 results for "image"(600ms)
119headers: {
120"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
121"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
122"Accept-Language": "en-US,en;q=0.5",
123"Referer": "https://steamcommunity.com/",
39if (response.status > 400) {
40const shortenedName = "Error (Forbidden)";
41const image = "/assets/spotify.svg";
42return { shortenedName, image };
43} else if (response.status === 204) {
44const shortenedName = "Currently Not Playing";
45const image = "/assets/spotify.svg";
46return { shortenedName, image };
47}
4849const song = await response.json();
50const image = song.item.album.images[0].url;
51const artistNames = song.item.artists.map(a => a.name);
52const link = song.item.external_urls.spotify;
65formattedArtist,
66artistLink,
67image,
68};
69} catch (error) {
70const shortenedName = "Error";
71const image = "/assets/spotify.svg";
72return { shortenedName, image };
73}
74};