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=991&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 13031 results for "api"(1274ms)

9 <title>Hello World</title>
10 <style>
11 @import url('https://fonts.googleapis.com/css2?family=Caveat:wght@700&family=Permanent+Marker&display=swap');
12
13 body {
9 <title>Hello World</title>
10 <style>
11 @import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Pacifico&display=swap');
12
13 body {
9 <title>Hello World</title>
10 <style>
11 @import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Pacifico&display=swap');
12
13 body {
1// This val retrieves the weather in Brooklyn, NY using the MetaWeather API
2
3export default async function main(req: Request): Promise<Response> {
4 const response = await fetch("https://www.metaweather.com/api/location/2459115/");
5 const weatherData = await response.json();
6
1// This val retrieves the weather in Brooklyn, NY using the MetaWeather API
2
3export default async function main(req: Request): Promise<Response> {
4 const response = await fetch("https://www.metaweather.com/api/location/2459115/");
5 const weatherData = await response.json();
6
1// This val fetches weather data from an open API
2// The approach involves using the fetch API provided by Deno
3// to retrieve weather information for a specific location
4
5export default async function main(req: Request): Promise<Response> {
6 const apiUrl = "https://api.open-meteo.com/v1/forecast?latitude=40.6782&longitude=-73.9442&hourly=temperature_2m&current_weather=true";
7
8 const response = await fetch(apiUrl);
9 const weatherData = await response.json();
10
2 // Helper functions for Blob storage
3 async function getBlob(key: string): Promise<any> {
4 const response = await fetch(`https://api.val.town/v/std/blob-${key}`);
5 if (!response.ok) throw new Error("Error fetching blob data");
6 return response.json();
8
9 async function setBlob(key: string, data: any): Promise<void> {
10 const response = await fetch(`https://api.val.town/v/std/blob-${key}`, {
11 method: "POST",
12 headers: { "Content-Type": "application/json" },

valPreviewmain.tsx3 matches

@iamseeleyUpdated 10 months ago
1export async function fetchVal(valId: string) {
2 try {
3 const response = await fetch(`https://api.val.town/v1/vals/${valId}`);
4 if (!response.ok) {
5 console.error(`Error fetching val with ID ${valId}:`, response.statusText);
15export async function evalCode(code: string) {
16 try {
17 const response = await fetch(`https://api.val.town/v1/eval`, {
18 method: 'POST',
19 headers: {
26 const errorText = await response.text();
27 console.error(`Error evaluating code:`, errorText);
28 return { error: `API Error: ${response.status} ${response.statusText}`, rawResponse: errorText };
29 }
30

examain.tsx1 match

@yawnxyzUpdated 10 months ago
2import Exa from "npm:exa-js"
3
4const exa = new Exa(Deno.env.get("EXA_API_KEY"));
5
6export const exaSearch = async ({ query, type, useAutoprompt, numResults, text, summary=true, highlights }) => {

btcmain.tsx3 matches

@parkUpdated 10 months ago
12 try {
13 const [priceResponse, historyResponse] = await Promise.all([
14 fetch(`https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=${CONFIG.COIN_GECKO_CURRENCY}`),
15 fetch(
16 `https://api.coingecko.com/api/v3/coins/bitcoin/market_chart?vs_currency=${CONFIG.COIN_GECKO_CURRENCY}&days=${CONFIG.COIN_GECKO_DAYS}&interval=daily`,
17 ),
18 ]);
19
20 if (!priceResponse.ok || !historyResponse.ok) throw new Error("API request failed");
21
22 const priceData = await priceResponse.json();

vapi-minutes-db1 file match

@henrywilliamsUpdated 2 days ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 2 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