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/image-url.jpg%20%22Optional%20title%22?q=api&page=1056&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 11852 results for "api"(1021ms)

twitterFollowingsmain.tsx1 match

@stevekrouseUpdated 1 year ago
3
4export let twitterFollowings = async ({bearerToken, handle}) => twitterJSON({
5 url: `https://api.twitter.com/2/users/${(await twitterUser({bearerToken, handle})).data.id}/following`,
6 bearerToken
7})

emailAPImain.tsx2 matches

@stevekrouseUpdated 1 year ago
1export let emailAPI = () => {
2 throw new Error("This API has moved to @std.emailAPI.");
3};

unserializeableLogExmain.tsx3 matches

@stevekrouseUpdated 1 year ago
2
3export let unserializeableLogEx = (async () => {
4 const { Configuration, OpenAIApi } = await import("npm:openai");
5 const configuration = new Configuration({
6 apiKey: process.env.openai,
7 });
8 const openai = new OpenAIApi(configuration);
9 console.log(openai);
10})();

stevekrouseFollowingmain.tsx1 match

@stevekrouseUpdated 1 year ago
7 twitterJSON;
8 let resp = await fetchJSON(
9 `https://api.twitter.com/1.1/friends/ids.json?user_id=${userId}`,
10 {
11 headers: {

privateAPIUnauthenticatedmain.tsx2 matches

@stevekrouseUpdated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const privateAPIUnauthenticated =
4 (await fetch("https://api.val.town/v1/run/stevekrouse.example3")).status;

pricemain.tsx2 matches

@stevekrouseUpdated 1 year ago
2
3export let price = async (asset, base = "usd", amount = 1) => {
4 let { rates } = await fetchJSON(`https://open.er-api.com/v6/latest/${base}`)
5 if (rates && rates[asset.toUpperCase()]) return amount * (1 / rates[asset.toUpperCase()])
6 else {
7 let { rates } = await fetchJSON('https://api.coingecko.com/api/v3/exchange_rates')
8 return amount * rates[base.toLowerCase()]?.value / rates[asset.toLowerCase()]?.value
9 }

verifyAPIAuthmain.tsx1 match

@stevekrouseUpdated 1 year ago
4import { getPublicKey } from "https://esm.town/v/stevekrouse/getPublicKey";
5
6export async function verifyAPIAuth({ signature, ...signed }) {
7 let { handle, t } = signed;
8 let publicKey = await getPublicKey(handle);

githubFileChangedmain.tsx1 match

@stevekrouseUpdated 1 year ago
4export let githubFileChanged = async (owner, repo, file) => {
5 let handle = `${owner}/${repo}/${file}`
6 let current = await fetchJSON(`https://api.github.com/repos/${owner}/${repo}/contents/${file}`)
7 let previous = githubFileCache[handle]
8 if (previous?.content && current?.content && previous?.content !== current?.content) {

mathFactmain.tsx1 match

@andrewhUpdated 1 year ago
3// Random math fact
4export let mathFact = fetchText(
5 "http://numbersapi.com/random/math"
6);
19 url,
20 username: url
21 .replace("https://api.github.com/users/", "")
22 .replace("/events", ""),
23 commitsLast7Days: commits.filter((commit) =>

social_data_api_project3 file matches

@tsuchi_yaUpdated 3 hours ago

simple-scrabble-api1 file match

@bryUpdated 20 hours ago
papimark21
socialdata
Affordable & reliable alternative to Twitter API: ➡️ Access user profiles, tweets, followers & timeline data in real-time ➡️ Monitor profiles with nearly instant alerts for new tweets, follows & profile updates ➡️ Simple integration