You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Bsuccess?q=api&page=38&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 11720 results for "api"(731ms)
1import process from "node:process";
2import { BskyAgent } from "npm:@atproto/api";
3import * as cheerio from "npm:cheerio";
4import fetch from "npm:node-fetch";
4041/**
42* Fetches tasks from Todoist API
43* @returns Array of Todoist tasks due today or overdue
44*/
45async function fetchTodoistTasks(): Promise<TodoistTask[]> {
46const apiToken = Deno.env.get("TODOIST_API_TOKEN");
4748if (!apiToken) {
49throw new Error("Todoist API Token is required");
50}
515556try {
57const response = await fetch("https://api.todoist.com/rest/v2/tasks", {
58method: "GET",
59headers: {
60"Authorization": `Bearer ${apiToken}`,
61"Content-Type": "application/json",
62},
6465if (!response.ok) {
66throw new Error(`Todoist API error: ${response.statusText}`);
67}
68