Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/?q=api&page=830&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 10973 results for "api"(1607ms)

dailyDadJokemain.tsx1 match

@ajn•Updated 1 year ago
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,

dailyDadJokeREADME.md2 matches

@ajn•Updated 1 year ago
113. 🤣🤣🤣🤣
12
13## API
14
15This val uses the [icanhazdadjoke API](https://icanhazdadjoke.com/api). You can find [more docs here](https://github.com/15Dkatz/official_joke_api), such as how to [filter by type](https://github.com/15Dkatz/official_joke_api?tab=readme-ov-file#grab-jokes-by-type).

telegramSendMessagemain.tsx3 matches

@sjmre•Updated 1 year ago
17}) =>
18 fetchJSON(
19 `https://api.telegram.org/bot${botToken}/sendMessage`,
20 {
21 method: "POST",
25
26export async function telegramSendAudioMessage(chatId: string, audioData: Uint8Array, botToken: string): Promise<void> {
27 const url = `https://api.telegram.org/bot${botToken}/sendAudio`;
28
29 // Assuming FormData is available or correctly polyfilled
34
35 try {
36 // Replace axios with Deno's fetch API, adapted for your setup
37 const response = await fetch(url, {
38 method: "POST",

azureNewtmain.tsx1 match

@suhaasy•Updated 1 year ago
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();

valToGHmain.tsx2 matches

@nbbaier•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=42";
3import { Octokit } from "npm:@octokit/rest";
127
128 try {
129 const { code } = await fetchJSON(`${API_URL}/v1/alias/${vtUser}/${valName}`, {
130 headers: { "Authorization": `Bearer ${Deno.env.get("valtown")}` },
131 });

openaiUploadFilemain.tsx1 match

@yawnxyz•Updated 1 year ago
17 formData.append("purpose", purpose);
18 formData.append("file", file, filename);
19 let result = await fetch("https://api.openai.com/v1/files", {
20 method: "POST",
21 headers: {

valTownSearchREADME.md1 match

@pomdtr•Updated 1 year ago
1# [Val Town Search](https://val-town-search.pomdtr.me)
2
3Search for vals using the Github API.
4
5Either use the provided UI, or the query param:

insecureSSLCertExamplemain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { insecureFetch } from "https://esm.town/v/stevekrouse/insecureFetch";
2
3const url = "https://assignment-api.uspto.gov/patent/basicSearch?query=1234567&fields=main&rows=20";
4const data = await insecureFetch(url);
5const text = await data.text();

valtownByExamplemain.tsx1 match

@pomdtr•Updated 1 year ago
1/** @jsxImportSource npm:hono/jsx **/
2
3import { api } from "https://esm.town/v/pomdtr/api";
4import { honoMiddleware } from "https://esm.town/v/pomdtr/codeOnValTown";
5import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";

dependenciesmain.tsx2 matches

@pomdtr•Updated 1 year ago
1import { api } from "https://esm.town/v/pomdtr/api";
2
3type ValRef = {
23export async function searchReferences(val: ValRef) {
24 const esmUrl = `https://esm.town/v/${val.author}/${val.name}`;
25 const { data: vals } = await api(`/v1/search/vals?query=${encodeURIComponent(esmUrl)}`, {
26 authenticated: true,
27 paginate: true,

daily-advice-app1 file match

@dcm31•Updated 2 days ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaine•Updated 3 days ago
apiv1
papimark21