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=975&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 13269 results for "api"(1271ms)

printedWhiteToadmain.tsx2 matches

@lazyplatypus•Updated 8 months ago
40
41 try {
42 const response = await fetch("/api/chat", {
43 method: "POST",
44 headers: { "Content-Type": "application/json" },
134
135async function server(request: Request): Promise<Response> {
136 if (request.method === "POST" && new URL(request.url).pathname === "/api/chat") {
137 const { messages, model } = await request.json();
138 const client = new Cerebras();

blobAdminREADME.md1 match

@psimyn•Updated 8 months ago
9[![](https://stevekrouse-button.express.val.run/Install)](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
12
13# TODO

honEmeraldSnailmain.tsx2 matches

@stevekrouse•Updated 8 months ago
104
105 try {
106 const response = await fetch("/api/chat", {
107 method: "POST",
108 headers: { "Content-Type": "application/json" },
209
210async function server(request: Request): Promise<Response> {
211 if (request.method === "POST" && new URL(request.url).pathname === "/api/chat") {
212 const { Anthropic } = await import("https://esm.sh/@anthropic-ai/sdk@0.17.1");
213 const { messages } = await request.json();

dailyDadJokeREADME.md2 matches

@rahulg•Updated 8 months ago
113. 🤣🤣🤣🤣
12
13## API
14
15This val uses the [icanhazdadjoke API](https://icanhazdadjoke.com/api). You can find [more docs here](https://github.com/15Dkatz/official_joke_api), such as how to [filter by type](https://github.com/15Dkatz/official_joke_api?tab=readme-ov-file#grab-jokes-by-type).

dailyDadJokemain.tsx1 match

@rahulg•Updated 8 months ago
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,

aqiREADME.md1 match

@unicorn•Updated 8 months ago
8
91. Click `Fork`
102. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
113. Click `Run`
12

scrapeZillowAPIREADME.md1 match

@rochambeau314•Updated 8 months ago
1Migrated from folder: group_house/scrapeZillowAPI

scrapeCraigslistAPIREADME.md1 match

@rochambeau314•Updated 8 months ago
1Migrated from folder: group_house/scrapeCraigslistAPI

calculateTransitAPIREADME.md1 match

@rochambeau314•Updated 8 months ago
1Migrated from folder: group_house/calculateTransitAPI

sunsetNYCalendarmain.tsx3 matches

@ejfox•Updated 8 months ago
1// This approach uses the Sunset and Sunrise API to get sunset times for New York,
2// and creates a simple form to generate a calendar of events occurring before sunset.
3
107async function getSunsetTime(date: Date): Promise<Date> {
108 const formattedDate = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
109 const response = await fetch(`https://api.sunrise-sunset.org/json?lat=40.7128&lng=-74.0060&date=${formattedDate}&formatted=0`);
110
111 if (!response.ok) {
116
117 if (!data.results || !data.results.sunset) {
118 throw new Error("Invalid response from sunset API");
119 }
120

vapi-minutes-db1 file match

@henrywilliams•Updated 3 days ago

vapi-minutes-db2 file matches

@henrywilliams•Updated 3 days ago
mux
Your friendly, neighborhood video API.
api