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=795&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 11896 results for "api"(1790ms)

graphqlAPIEndpointmain.tsx1 match

@flesch•Updated 6 months ago
9 hello: {
10 type: GraphQLString,
11 resolve: () => "Hello from Val Town GraphQL API!",
12 },
13 },

altairClientREADME.md2 matches

@flesch•Updated 6 months ago
16 hello: {
17 type: GraphQLString,
18 resolve: () => "Hello from Val Town GraphQL API!",
19 },
20 },
49```
50
51↑ [https://www.val.town/v/flesch/graphqlAPIEndpoint](https://www.val.town/v/flesch/graphqlAPIEndpoint)
52
53

getProfileProfilePagemain.tsx1 match

@elliotbraem•Updated 6 months ago
204 <title>${accountId}'s Profile</title>
205 <meta name="viewport" content="width=device-width, initial-scale=1">
206 <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap" rel="stylesheet">
207 <script src="https://cdn.tailwindcss.com"></script>
208 <script>

blob_adminmain.tsx3 matches

@pkf•Updated 6 months ago
14/**
15 * This val website is protected by a password.
16 * Access requires an API token named "blob".
17 */
18
143// New authentication middleware
144const authMiddleware = async (c, next) => {
145 const apiToken = c.req.header('Authorization')?.split(' ')[1];
146 if (apiToken !== Deno.env.get('blob')) {
147 return new Response('Unauthorized', { status: 401 });
148 }

blob_adminREADME.md1 match

@pkf•Updated 6 months ago
11[![](https://stevekrouse-button.web.val.run/Install)](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
12
13It 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).
14
15# TODO

falDemoAppmain.tsx2 matches

@spigooli•Updated 6 months ago
15 try {
16 const fal = createFalClient({
17 proxyUrl: "/api/fal/proxy",
18 });
19
139 }
140
141 if (url.pathname === "/api/fal/proxy") {
142 return falProxyRequest(req);
143 }

elegantJadeParrotfishmain.tsx6 matches

@temptemp•Updated 6 months ago
89 <title>${id}</title>
90 <style>
91 @import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;700&display=swap');
92
93 html,
151 <title>Video Downloader</title>
152 <style>
153 @import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;700&display=swap');
154
155 body {
242 <center>
243 <br>
244 <a href="https://www.buymeacoffee.com/cooldevguy"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a cool-milk&emoji=ðlug=cooldevguy&button_colour=49a835&font_colour=ffffff&font_family=Comic&outline_colour=ffffff&coffee_colour=FFDD00" /></a>
245 <br>
246 <br>
275 <title>${id}</title>
276 <style>
277 @import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;700&display=swap');
278
279 html,
333// const { provider, id } = c.req.param();
334// if (!["flixhq", "showbox"].includes(provider)) {
335// return c.json({ error: "Invalid API request" }, 500);
336// }
337// // const cache = await blob.getJSON(id);
363// }
364// });
365app.get("api/:type/:fileId", async (c) => {
366 const performanceTimer = Date.now();
367 const { type, fileId } = c.req.param();

verbalScarletAntelopemain.tsx4 matches

@vawogbemi•Updated 6 months ago
62 const fetchStories = async () => {
63 try {
64 const response = await fetch("/api/stories");
65 if (!response.ok) throw new Error("Failed to fetch dates");
66 const data = await response.json();
76 try {
77 dispatch({ type: "loading", value: true });
78 const response = await fetch(`/api/comments?query=${encodeURIComponent(query)}&story=${story}&page=${page}`);
79 if (!response.ok) throw new Error("Failed to fetch comments");
80 const data = await response.json();
377export default async function(req: Request): Promise<Response> {
378 const url = new URL(req.url);
379 if (url.pathname === "/api/stories") {
380 const storySearch = await hnSearch({
381 search_by_date: true,
398 }
399
400 if (url.pathname === "/api/comments") {
401 const params = url.searchParams;
402 const query = params.get("query") || "";

forbearingOrangePlatypusmain.tsx4 matches

@Felistan•Updated 6 months ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { LibsqlError, type ResultSet, type Row, type TransactionMode } from "npm:@libsql/client";
3import { z } from "npm:zod";
35
36async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
50
51async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
52 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
53 method: "POST",
54 headers: {
78
79/* Val Town's Turso Proxy returns rows as an array of values
80 * Yet the LibSQL API has a Row type which behave as an array or object,
81 * ie you can access it via numerical index or string
82 */

sqlitemain.tsx4 matches

@Felistan•Updated 6 months ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { LibsqlError, type ResultSet, type Row, type TransactionMode } from "npm:@libsql/client";
3import { z } from "npm:zod";
35
36async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
50
51async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
52 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
53 method: "POST",
54 headers: {
78
79/* Val Town's Turso Proxy returns rows as an array of values
80 * Yet the LibSQL API has a Row type which behave as an array or object,
81 * ie you can access it via numerical index or string
82 */

social_data_api_project3 file matches

@tsuchi_ya•Updated 1 day ago

simple-scrabble-api1 file match

@bry•Updated 1 day ago
apiv1
papimark21