You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/...?q=api&page=48&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 19255 results for "api"(1258ms)
51async function sendWhatsApp(text: string) {
52const enc = encodeURIComponent(text.substring(0, 900)); // 900 char max
53const url = `https://api.callmebot.com/whatsapp.php?phone=${PHONE}`
54+ `&text=${enc}&apikey=${KEY}`;
55await fetch(url).then(r => r.text());
56}
3constructor() {
4this.snippets = [];
5this.API_BASE = '/backend/api';
6}
78// Load all snippets from API
9async loadSnippets() {
10try {
11const response = await fetch(`${this.API_BASE}/snippets`);
12const result = await response.json();
13
97try {
98const url = isUpdate && snippetId
99? `${this.API_BASE}/snippets/${snippetId}`
100: `${this.API_BASE}/snippets`;
101
102const method = isUpdate ? 'PUT' : 'POST';
127async deleteSnippet(id) {
128try {
129const response = await fetch(`${this.API_BASE}/snippets/${id}`, {
130method: 'DELETE',
131});