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%22Image%20title%22?q=api&page=1055&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 11844 results for "api"(1089ms)

testVTClient2main.tsx3 matches

@stevekrouse•Updated 1 year ago
1export const testVTClient2 = (async () => {
2 const { createApiClient } = await import(
3 "https://esm.sh/gh/nbbaier/valtown-zodios/src/spec/valtown-client.ts"
4 );
5 const apiClient = createApiClient("https://api.val.town");
6 const params = {
7 params: { username: "nbbaier", val_name: "hello" },
8 };
9 const user = await apiClient.getValname(params);
10 return user;
11})();

githubFollowingmain.tsx1 match

@stevekrouse•Updated 1 year ago
5export let githubFollowing =
6 (await fetchJSON(
7 "https://api.github.com/users/stevekrouse/following",
8 )).map((f) => f.login).map((h) => ({
9 h,

twitterFollowingsmain.tsx1 match

@stevekrouse•Updated 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

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

unserializeableLogExmain.tsx3 matches

@stevekrouse•Updated 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

@stevekrouse•Updated 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

@stevekrouse•Updated 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

@stevekrouse•Updated 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

@stevekrouse•Updated 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

@stevekrouse•Updated 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) {

simple-scrabble-api1 file match

@bry•Updated 12 hours ago

social_data_api_project3 file matches

@tsuchi_ya•Updated 20 hours ago
apiv1
papimark21