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/$%7Bart_info.art.src%7D?q=api&page=988&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 11754 results for "api"(2694ms)

r2Proxymain.tsx2 matches

@stevekrouseUpdated 1 year ago
2import { pros } from "https://esm.town/v/stevekrouse/pros";
3import { email } from "https://esm.town/v/std/email?v=9";
4import { verifyAPIAuth } from "https://esm.town/v/stevekrouse/verifyAPIAuth";
5
6export async function r2Proxy(key, value, auth) {
7 let { handle } = await verifyAPIAuth(auth);
8 if (!handle)
9 return "Could not verify auth";

getDiscordGuildsmain.tsx2 matches

@stevekrouseUpdated 1 year ago
1import { discordAPI } from "https://esm.town/v/stevekrouse/discordAPI";
2
3export let getDiscordGuilds = ({token, tokenType}) => discordAPI({
4 token,
5 tokenType,

discordAPImain.tsx2 matches

@stevekrouseUpdated 1 year ago
2
3// token_type = 'Bot' | 'Bearer'
4export let discordAPI = ({path, tokenType, token}) => fetchJSON(
5 `https://discord.com/api/${path}`,
6
7 // https://discord.com/developers/docs/reference#authentication

discordFetchmain.tsx1 match

@stevekrouseUpdated 1 year ago
2
3export let discordFetch = (token, route) => fetchJSON(
4 `https://discord.com/api/${route}`,
5 {
6 headers: {

testWebhookmain.tsx1 match

@stevekrouseUpdated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let testWebhook = fetchJSON("https://api.val.town/eval/@stevekrouse.webhook", {method: "POST"})

fetchHeaders2main.tsx1 match

@stevekrouseUpdated 1 year ago
2
3export let fetchHeaders2 = Object.fromEntries(
4 (await fetch("https://swapi.dev/api/people/1/")).headers
5);

hootsuiteNasamain.tsx2 matches

@stevekrouseUpdated 1 year ago
2
3export async function hootsuiteNasa(req: express.Request, res: express.Response) {
4 const NASA_ROOT = "https://images-api.nasa.gov";
5 const alphaNumericSpaces = new RegExp("^[a-zA-Z0-9\\s-_]+$");
6 const acceptableRedirectUri = new RegExp(
7 "^https:\/\/api-auth.hootsuite.com\/app-directory\/apps\/[0-9]+\/oauth2\/callback$",
8 );
9 if (req.path === "/v1/media") {

getRandomPokemonmain.tsx1 match

@gabbyUpdated 1 year ago
3export let getRandomPokemon = async () => {
4 const id = Math.floor(Math.random() * 151);
5 const url = `https://pokeapi.co/api/v2/pokemon/${id}`;
6 const data = await fetchData(url);
7 console.log(data.name);

myApimain.tsx1 match

@jakesingUpdated 1 year ago
1import { myName } from "https://esm.town/v/jakesing/myName";
2
3export function myApi() {
4 return "hi " + myName;
5}

myApimain.tsx1 match

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

new-val-api-21 file match

@shouserUpdated 1 hour ago
This is an example of using the API to create a val.

gpt-image-test

@CaptainJackUpdated 17 hours ago
测试 gpt image 的不同 api 能否满足图片生成要求
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