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?q=api&page=1025&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 12655 results for "api"(1222ms)

getslackmain.tsx1 match

@curtcoxUpdated 1 year ago
14 "redirect": req.redirect,
15 "searchParams": Object.fromEntries(searchParams.entries()),
16 "docs": "https://developer.mozilla.org/en-US/docs/Web/API/Request",
17 });
18};

get_weather_messagemain.tsx2 matches

@cosmoUpdated 1 year ago
2import { getCurrentWeather } from "https://esm.town/v/cosmo/get_current_weather";
3
4export async function getWeatherMessage(apiKey, latitude, longitude) {
5 const currentWeather = await getCurrentWeather(latitude, longitude),
6 { icon } = currentWeather,
27 { role: "user", content: JSON.stringify(weather) },
28 ],
29 chatResponse = await chat(apiKey, messages),
30 message = chatResponse.choices[0].message.content;
31

get_current_weathermain.tsx1 match

@cosmoUpdated 1 year ago
1export async function getCurrentWeather(latitude = 0, longitude = 0) {
2 const pointsResponse = await fetch(`https://api.weather.gov/points/${latitude},${longitude}`),
3 { properties: { forecastHourly } } = await pointsResponse.json(),
4 forecastResponse = await fetch(forecastHourly),

ninja_keysmain.tsx2 matches

@pomdtrUpdated 1 year ago
15 <link
16 rel="preload"
17 href="https://fonts.googleapis.com/css?family=Inter:300,400,500"
18 as="style"
19 type="text/css"
20 />
21 <link
22 href="https://fonts.googleapis.com/css?family=Material+Icons&display=swap"
23 rel="stylesheet"
24 />

echoREADME.md1 match

@curtcoxUpdated 1 year ago
1# Echo incoming request as JSON
2See https://developer.mozilla.org/en-US/docs/Web/API/Request
3
4

honoTanaEndpointmain.tsx3 matches

@nbbaierUpdated 1 year ago
1import { saveToTana } from "https://esm.town/v/nbbaier/saveToTana";
2import { APIPlainNode } from "https://esm.town/v/nbbaier/tanaTypes";
3import { Hono } from "npm:hono";
4
5const token = Deno.env.get("tanaInputAPI");
6
7export const honoTanaEndpoint = async (req: Request) => {
10 let { text, url } = c.req.query();
11
12 const payload: APIPlainNode = {
13 name: text,
14 children: [

createValmain.tsx1 match

@andreterronUpdated 1 year ago
7 privacy?: "public" | "unlisted" | "private";
8}) => {
9 return fetchJSON("https://api.val.town/v1/vals", {
10 method: "post",
11 bearer: token,

longest_valmain.tsx5 matches

@andreterronUpdated 1 year ago
1import { paginateAPI } from "https://esm.town/v/andreterron/paginateAPI";
2import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
4
11};
12const me = await fetchJSON(
13 `${API_URL}/v1/me`,
14 opts,
15);
16// TODO: Paginate
17const vals = await paginateAPI(
18 `${API_URL}/v1/users/${me.id}/vals?limit=100`,
19 opts,
20);

API_URLmain.tsx2 matches

@stdUpdated 1 year ago
2 // try/catch prevents crashes if the script doesn't have env access
3 try {
4 return Deno.env.get("VALTOWN_API_URL");
5 } catch {}
6}
7
8export const API_URL = envOrUndefined("VALTOWN_API_URL") ?? "https://api.val.town";

chat_openaimain.tsx2 matches

@cosmoUpdated 1 year ago
1const { default: OpenAI } = await import("npm:openai");
2
3export async function chat(apiKey, messages) {
4 const openai = new OpenAI({ apiKey });
5
6 return openai.chat.completions.create({

vapi-minutes-db1 file match

@henrywilliamsUpdated 11 hours ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 13 hours ago
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
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com