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/?q=api&page=19&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 4213 results for "api"(349ms)

JimeluStevensApp.tsx8 matches

@luke_f•Updated 3 days ago
10import { NotebookView } from "./NotebookView.tsx";
11
12const API_BASE = "/api/memories";
13const MEMORIES_PER_PAGE = 20; // Increased from 7 to 20 memories per page
14
90
91 // Fetch avatar image
92 fetch("/api/images/stevens.jpg")
93 .then((response) => {
94 if (response.ok) return response.blob();
104
105 // Fetch wood background
106 fetch("/api/images/wood.jpg")
107 .then((response) => {
108 if (response.ok) return response.blob();
133 setError(null);
134 try {
135 const response = await fetch(API_BASE);
136 if (!response.ok) {
137 throw new Error(`HTTP error! status: ${response.status}`);
176
177 try {
178 const response = await fetch(API_BASE, {
179 method: "POST",
180 headers: { "Content-Type": "application/json" },
199
200 try {
201 const response = await fetch(`${API_BASE}/${id}`, {
202 method: "DELETE",
203 });
231
232 try {
233 const response = await fetch(`${API_BASE}/${editingMemory.id}`, {
234 method: "PUT",
235 headers: { "Content-Type": "application/json" },
606 <div className="font-pixel text-[#f8f1e0]">
607 <style jsx>{`
608 @import url("https://fonts.googleapis.com/css2?family=Pixelify+Sans&display=swap");
609
610 @tailwind base;

GlancerREADME.md1 match

@bradnoble•Updated 4 days ago
1# Routes Directory
2
3This directory contains all the route handlers for the webhookAPI application. Each file exports a Hono app that handles a specific route or group of related routes.
4
5## Structure

Glancerresets4 matches

@bradnoble•Updated 4 days ago
4// Initialize Notion client
5const notion = new Client({
6 auth: Deno.env.get("NOTION_API_KEY"),
7});
8
37 // the block exists, so you can do the reset
38
39 // reset via the API
40 // this way we keep the notion data and the blob data (our cache) in sync
41 // the API resets the blocks on notion pages, and also knows what to do with the blob
42 // (note the x-blob-key header)
43 if (content != "default" && diffInMinutes > .5) {
48 "x-asking-for": "default",
49 "x-blob-key": item.key,
50 "x-api-key": Deno.env.get("X_API_KEY"),
51 },
52 body: JSON.stringify({

Glancerproperty-injections.ts1 match

@bradnoble•Updated 4 days ago
7// Initialize Notion client
8const notion = new Client({
9 auth: Deno.env.get("NOTION_API_KEY"),
10});
11

GlancernotionHelpers.ts1 match

@bradnoble•Updated 4 days ago
4// Initialize Notion client
5const notion = new Client({
6 auth: Deno.env.get("NOTION_API_KEY"),
7});
8

Glancerhelpers.ts1 match

@bradnoble•Updated 4 days ago
70 return faviconUrl;
71 } catch (error) {
72 console.error("Error scraping favicon:", error);
73 return null;
74 }

Glancerexample-guest-welcome.ts1 match

@bradnoble•Updated 4 days ago
7// Initialize Notion client
8const notion = new Client({
9 auth: Deno.env.get("NOTION_API_KEY"),
10});
11

Glancerexample-database-page.ts2 matches

@bradnoble•Updated 4 days ago
9// Initialize Notion client
10const notion = new Client({
11 auth: Deno.env.get("NOTION_API_KEY"),
12});
13
61 // unless there's already a blob key that matches
62 // to see if there's a match, loop through blobs rather than traversing the notion page
63 // though not ideal, it's faster than doing the API calls necessary to traverse the Notion page
64 const checkForBlob = async () => {
65 const items = await blob.list(slug.split(".")[0]);

Glancerexample-database-pages.ts1 match

@bradnoble•Updated 4 days ago
7// Initialize Notion client
8const notion = new Client({
9 auth: Deno.env.get("NOTION_API_KEY"),
10});
11

Glancerexample-child-pages.ts1 match

@bradnoble•Updated 4 days ago
7// Initialize Notion client
8const notion = new Client({
9 auth: Deno.env.get("NOTION_API_KEY"),
10});
11

PassphraseAPI2 file matches

@wolf•Updated 19 hours ago

openapi2 file matches

@stevekrouse•Updated 3 days ago
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com
fiberplane
Purveyors of Hono tooling, API Playground enthusiasts, and creators of 🪿 HONC 🪿 (https://honc.dev)