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=960&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 13806 results for "api"(1034ms)

sqlite2main.tsx2 matches

@std•Updated 5 months ago
2
3export const sqlite = createClient({
4 url: "https://api.val.town/v2/sqlite/",
5 authToken: Deno.env.get("VAL_TOWN_API_KEY"),
6});

sqlite2README.md1 match

@std•Updated 5 months ago
1# SQLite2 - [Docs ↗](https://docs.val.town/std/sqlite)
2
3_This is our second generation SQLite client: it exposes a different API than [std/sqlite](https://www.val.town/v/std/sqlite).
4Specifically, this will support the full [@libsql/client interface](https://docs.turso.tech/sdk/ts/reference#simple-query)._
5

sympatheticApricotOttermain.tsx1 match

@judeholz•Updated 5 months ago
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();

stylishScarletPossummain.tsx1 match

@emre_karaman•Updated 5 months ago
6async function fetchRandomJoke() {
7 const response = await fetch(
8 "https://official-joke-api.appspot.com/random_joke",
9 );
10 return response.json();

modestPurpleLousemain.tsx1 match

@gavin_nittoli_nu•Updated 5 months ago
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();

proficientTealFrogmain.tsx1 match

@mcnew_mitch•Updated 5 months ago
4function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();

inspiringTomatoFleamain.tsx1 match

@abhinavtavildar•Updated 5 months ago
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();

efficientBronzeKoimain.tsx1 match

@aszeto99910•Updated 5 months ago
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();

commendableTealFerretmain.tsx10 matches

@Bossbaby•Updated 5 months ago
65 const mapRef = useRef(null);
66 const [searchQuery, setSearchQuery] = useState('');
67 const [mapInstance, setMapInstance] = useState(null);
68 const [isLeafletLoaded, setIsLeafletLoaded] = useState(false);
69 const [mapLoadError, setMapLoadError] = useState(null);
101 // Search functionality
102 const handleSearch = useCallback(async () => {
103 if (!searchQuery || !mapInstance || !window.L) return;
104
105 try {
116 // Remove previous search marker if exists
117 if (window.searchMarker) {
118 mapInstance.removeLayer(window.searchMarker);
119 }
120
126 iconSize: [20, 20]
127 })
128 }).addTo(mapInstance);
129
130 // Store the marker globally to remove it later
132
133 // Center map on searched location
134 mapInstance.setView([lat, lon], 15);
135
136 // Create a popup for the searched location
148 </div>
149 `)
150 .openOn(mapInstance);
151
152 // Add event listener to confirm location
169 console.error('Search failed', error);
170 }
171 }, [searchQuery, mapInstance, onLocationSelect]);
172
173 // Map initialization effect
174 useEffect(() => {
175 // Ensure Leaflet is loaded and map container exists
176 if (isLeafletLoaded && window.L && mapRef.current && !mapInstance) {
177 try {
178 const L = window.L;
183
184 // Store map instance
185 setMapInstance(map);
186
187 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
304 }
305 }
306 }, [isLeafletLoaded, locations, defaultLocation, onLocationFound, onLocationSelect, mapInstance]);
307
308 // Render error state if map loading fails

observantApricotGoatmain.tsx1 match

@trentonallan•Updated 5 months ago
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();

new-val-api-demo

@shouser•Updated 5 hours ago
This is an example of using the API to create a val.

groq-api2 file matches

@cameronpak•Updated 9 hours ago
mux
Your friendly, neighborhood video API.
api