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=1514&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 18048 results for "api"(1335ms)

asciiImageExamplemain.tsx1 match

@maxm•Updated 12 months ago
3export default async function(req: Request): Promise<Response> {
4 const { string, stringColor } = await imageToAscii(
5 "https://webcams.nyctmc.org/api/cameras/9fa5b0dd-e955-449e-97e1-9c53ad9c23a8/image",
6 150,
7 );

geolocation_api_demoREADME.md1 match

@stevekrouse•Updated 12 months ago
1Migrated from folder: Archive/geolocation_api_demo

asciiNycCamerasREADME.md1 match

@maxm•Updated 12 months ago
12
13
14NYC has a bunch of traffic cameras and makes them available through static images [like this one](https://webcams.nyctmc.org/api/cameras/858ef4e8-5058-4db2-96e2-70f71b65aa24/image). If you refresh the page you'll see the image update every 2 seconds or so. I thought it might be fun to make these cameras viewable as an ASCII art video feed. I made a [small library](https://www.val.town/v/maxm/imageToAscii) that takes most of its logic from [this repo](https://github.com/victorqribeiro/imgToAscii). You can see a basic example of how to convert [any image to ASCII here](https://www.val.town/v/maxm/asciiImageExample).
15
16I pull in [NYC GeoJSON from here](https://observablehq.com/@miaozhang/maps) and then hook up a Server-Sent Events endpoint to stream the ASCII updates to the browser. (Polling would work just as well, I've just been on a bit of a SSE kick lately.)

apricotPartridgemain.tsx1 match

@pomdtr•Updated 12 months ago
2
3// use my private proxy
4setEnv("VALTOWN_API_URL", "https://pomdtr-tursoproxy.web.val.run");
5
6// need to be dynamic

createTursoProxymain.tsx1 match

@pomdtr•Updated 12 months ago
29 app.all("*", async (c) => {
30 const { path } = c.req;
31 return await fetch(`https://api.val.town${path}`, {
32 method: c.req.method,
33 headers: c.req.raw.headers,

createGeneratedValREADME.md2 matches

@yawnxyz•Updated 12 months ago
1# Use GPT to generate vals on your account!
2
3Describe the val that you need, call this function, and you'll get a new val on your workspace generated by OpenAI's API!
4
5First, ensure you have a [Val Town API Token](https://www.val.town/settings/api), then call `@andreterron.createGeneratedVal({...})` like this [example](https://www.val.town/v/andreterron.untitled_tomatoKiwi):
6
7```javascript

honoTanaEndpointmain.tsx3 matches

@impedivity•Updated 12 months ago
1import { saveToTana } from "https://esm.town/v/impedivity/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 console.log(c.req);
12 const payload: APIPlainNode = {
13 name: text,
14 children: [

tanaSavemain.tsx3 matches

@impedivity•Updated 12 months ago
1import { saveToTana } from "https://esm.town/v/impedivity/saveToTana";
2import { APIPlainNode } from "https://esm.town/v/nbbaier/tanaTypes";
3import { Hono } from "npm:hono";
4
5const token = Deno.env.get("tanaInputAPI");
6console.log(token);
7console.log(Request);
16 let { text, url } = c.req.query();
17 console.log(c.req);
18 const payload: APIPlainNode = {
19 name: text,
20 children: [

createTursoProxyREADME.md1 match

@pomdtr•Updated 1 year ago
15
16// use my private proxy
17setEnv("VALTOWN_API_URL", "<proxy-url>");
18
19// wire sqlite explorer to a turso db !

litExampleREADME.md1 match

@triptych•Updated 1 year ago
1# lit
2
3[Lit](https://lit.dev/docs/ssr/server-usage/) is kind of like Google's answer to React: it's a little more reliant on browser APIs like custom elements and the shadow DOM, a little less 'magic', like using JSX.
4
5This is an example of using Lit and rendering it straight to a string, which is something that's recently popular. It works pretty well, right off the bat: Lit provides nice ESM modules and a pretty smooth workflow!

Apiify11 file matches

@wolf•Updated 9 hours ago

dailyQuoteAPI

@Souky•Updated 2 days ago
Kapil01
apiv1