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=1458&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 16467 results for "api"(1446ms)

fetchHeaders2main.tsx1 match

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

hootsuiteNasamain.tsx2 matches

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

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

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

myApimain.tsx1 match

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

convertTodoItemsToGamePlansmain.tsx5 matches

@thomasatflexos•Updated 1 year ago
33 "model": "gpt-3.5-turbo",
34 });
35 let openApiKey = process.env.OPEN_API_KEY;
36 var requestOptions = {
37 method: "POST",
38 headers: {
39 "Content-Type": "application/json",
40 "Authorization": `Bearer ${openApiKey}`,
41 },
42 body: rawBody,
43 redirect: "follow",
44 };
45 let openApiResponse = await fetch(
46 "https://api.openai.com/v1/chat/completions",
47 requestOptions,
48 );
49 let jsonResponse = await openApiResponse.json();
50 let choice = jsonResponse?.choices[0]?.message.content;
51 if (!choice) {

myApimain.tsx1 match

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

myApimain.tsx1 match

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

myApimain.tsx1 match

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

githubFollowingmain.tsx1 match

@alexmcroberts•Updated 1 year ago
3// Github following
4export let githubFollowing = fetchJSON(
5 "https://api.github.com/users/stevekrouse/following"
6);

Schedule

@Ozy•Updated 2 hours ago
Schedule_api

googleGeminiAPI2 file matches

@michaelwschultz•Updated 19 hours ago
Kapil01
apiv1