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/$%7Burl%7D?q=api&page=1382&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 15445 results for "api"(4525ms)

myApimain.tsx1 match

@mmcc•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@alexwarth•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

capitalizeWordmain.tsx3 matches

@mkeller7•Updated 1 year ago
1export let capitalizeWord = async (word) => {
2 const { capitalize } = await import("npm:lodash-es");
3 return capitalize(word);
4};

openAiModerationmain.tsx7 matches

@patrickjm•Updated 1 year ago
3/**
4 * Calls the OpenAI moderation model. Useful for determining if OpenAI will flag something you did.
5 * https://platform.openai.com/docs/api-reference/moderations
6 */
7export let openAiModeration = async ({
8 apiKey,
9 input,
10 model,
11}: {
12 apiKey: string,
13 input: string|string[],
14 model?: "text-moderation-latest" | "text-moderation-stable",
15}) => {
16 if (!apiKey) {
17 throw new Error("You must provide an OpenAI API Key");
18 }
19 const body: { model?: string, input: string|string[] } = {
24 }
25 const result = await fetchJSON(
26 "https://api.openai.com/v1/moderations",
27 {
28 method: "POST",
29 headers: {
30 Authorization: `Bearer ${apiKey}`,
31 },
32 body: JSON.stringify(body),

myApimain.tsx1 match

@salman•Updated 1 year ago
1export function myApi(url) {
2 return "https://tldrify.com/ajaxproxy?url=" + url;
3}

incrementAPICountermain.tsx3 matches

@andreterron•Updated 1 year ago
1let { apiCounter } = await import("https://esm.town/v/andreterron/apiCounter");
2
3export let incrementAPICounter = (req, res: express.Response) => {
4 apiCounter += 1;
5 res.send(JSON.stringify({ status: "Success!" }));
6};

searchTweetsmain.tsx1 match

@andreterron•Updated 1 year ago
8 const q = new URLSearchParams({ query, ...params }).toString();
9 const results = await fetchJSON(
10 `https://api.twitter.com/2/tweets/search/recent?${q}`,
11 {
12 headers: {

myApimain.tsx1 match

@triggatron•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

getPoemForTimemain.tsx1 match

@crsven•Updated 1 year ago
3export let getPoemForTime = async (time: string) => {
4 const poemResponse = await fetch(
5 `https://poem.town/api/v1/clock/poem/${time}`
6 );
7 const poemJson = await poemResponse.json();

postToMastodonmain.tsx2 matches

@sebdd•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export function postToMastodon(mastodonApiUrl, mastodonAccessToken, status) {
4 return fetch(
5 `${mastodonApiUrl}/statuses?access_token=${mastodonAccessToken}`,
6 {
7 headers: {

HN-fetch-call2 file matches

@ImGqb•Updated 1 day ago
fetch HackerNews by API

token-server1 file match

@kwhinnery_openai•Updated 3 days ago
Mint tokens to use with the OpenAI Realtime API for WebRTC
Kapil01
apiv1