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=832&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"(1560ms)

postHogAPICapturemain.tsx2 matches

@daisuke•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function postHogAPICapture({ key, event, properties, distinct_id }: {
4 key: string;
5 event: string;
8}) {
9 const body = {
10 "api_key": key,
11 "event": event,
12 "properties": properties,

limeNightingalemain.tsx1 match

@aashlayhang•Updated 1 year ago
9async function fetchRandomJoke() {
10 const response = fetch(
11 "https://official-joke-api.appspot.com/random_joke",
12 );
13 return response.json();

goldCheetahmain.tsx1 match

@matthewhu8•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();

goldTyrannosaurusmain.tsx1 match

@archer1121•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();

get_gemini_modelsmain.tsx2 matches

@cotr•Updated 1 year ago
9export async function getGeminiModels(): Promise<GeminiModel[]> {
10 try {
11 const API_KEY = process.env.GEMINI_API_KEY;
12
13 const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models?key=${API_KEY}`);
14
15 const data = await response.json();

openaimain.tsx1 match

@stevekrouse•Updated 1 year ago
3async function getOpenAI() {
4 // if you don't have a key, use our std library version
5 if (Deno.env.get("OPENAI_API_KEY") === undefined) {
6 const { OpenAI } = await import("https://esm.town/v/std/openai");
7 return new OpenAI();

chocolateDovemain.tsx1 match

@leopivatoneu•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();

dailyDadJokemain.tsx1 match

@viniciuscainelli•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,

sapphireHummingbirdmain.tsx1 match

@anyak_hemlani•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();

azureBasiliskmain.tsx1 match

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

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