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=1036&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 12044 results for "api"(1070ms)

gpt3main.tsx5 matches

@yuval_dikermanUpdated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let gpt3 = async (prompt: string, openAiApiKey: string): Promise<string> => {
4 if (!prompt || !openAiApiKey) {
5 let cat = await fetch("https://catfact.ninja/fact");
6 let { fact } = await cat.json();
7 return Promise.reject(
8 `Prompt text or api key was not provided. \n \n here's a cat fact: \n ${fact}`,
9 );
10 }
11 const content = await fetch("https://api.openai.com/v1/chat/completions", {
12 method: "POST",
13 body: JSON.stringify({
17 }),
18 headers: {
19 "Authorization": `Bearer ${openAiApiKey}`,
20 "Content-Type": "application/json",
21 },

streamingTestmain.tsx1 match

@jacoblee93Updated 1 year ago
8 maxTokens: 25,
9 streaming: true,
10 openAIApiKey: process.env.OPENAI_API_KEY,
11 });
12 const response = await chat.call("Tell me a joke.", undefined, [

myApimain.tsx1 match

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

githubStarredmain.tsx1 match

@mklwlodUpdated 1 year ago
3// GitHub starred repos
4export let githubStarred = fetchJSON(
5 "https://api.github.com/users/klapacz/starred"
6);

starWarsmain.tsx2 matches

@kallevUpdated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Explore the Star Wars universe, from StarWarsAPI
4export let starWars = fetchJSON(
5 "https://swapi.dev/api/people/1/"
6);

myApimain.tsx1 match

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

bookReservationOnResymain.tsx7 matches

@alpUpdated 1 year ago
30}) => {
31 const { z } = await import("npm:zod");
32 const RESY_API_URL = "https://api.resy.com";
33 const RESY_DEFAULT_HEADERS = {
34 accept: "application/json, text/plain, */*",
35 "accept-encoding": "gzip, deflate, br",
36 "accept-language": "en-US,en;q=0.9",
37 authorization: 'ResyAPI api_key="VbWk7s3L4KiK5fzlO7JD3Q5EYolJI7n5"',
38 "x-origin": "https://resy.com",
39 origin: "https://resy.com/",
143 params.email
144 )}&password=${encodeURIComponent(params.password)}`;
145 const response = await fetch(`${RESY_API_URL}/3/auth/password`, {
146 method: "POST",
147 body: body,
164 seats: number;
165 }) => {
166 const url = `${RESY_API_URL}/3/details`;
167 const response = await fetch(url.toString(), {
168 method: "POST",
183 seats: number;
184 }) => {
185 const url = `${RESY_API_URL}/4/find`;
186 const searchParams = new URLSearchParams();
187 searchParams.set("lat", "0");
206 city: string;
207 }) => {
208 const url = `${RESY_API_URL}/3/venue`;
209 const searchParams = new URLSearchParams();
210 searchParams.set("url_slug", params.slug);
222 authToken: string;
223 }) => {
224 const response = await fetch(`${RESY_API_URL}/3/book`, {
225 method: "POST",
226 headers: {

myApimain.tsx1 match

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

myApimain.tsx1 match

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

ipmain.tsx1 match

@hanuUpdated 1 year ago
1import { fetchJSON } from "https://esm.town/v/hanu/fetchJSON";
2
3export let ip = await fetchJSON("https://api.ipify.org?format=json");

social_data_api_project3 file matches

@tsuchi_yaUpdated 22 hours ago

simple-scrabble-api1 file match

@bryUpdated 4 days 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