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=728&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 11604 results for "api"(810ms)

inspiringLavenderTakinmain.tsx1 match

@stevekrouseUpdated 4 months ago
9const STARTER_PROMPTS = [
10 "todo list app persisted in local storage",
11 "weather app using open-meteo API",
12 "interactive markdown editor with live preview",
13 "pomodoro timer with sound notifications",

slackScoutREADME.md4 matches

@kamathUpdated 4 months ago
7## Getting Started
8To run Slack Scout, you’ll need a
9- Browserbase API key
10- Slack Webhook URL: setup [here](https://docs.val.town/integrations/slack/send-messages-to-slack/)
11- Twitter Developer API key
12
13### Browserbase
19### Twitter
20
21We’ve decided to use the Twitter API to include Twitter post results. It costs $100 / month to have a Basic Twitter Developer account. _If you decide to use Browserbase, we can lend our token. Comment below for access._
22
23Once you have the `SLACK_WEBHOOK_URL`, `BROWSERBASE_API_KEY`, and `TWITTER_BEARER_TOKEN`, input all of these as [Val Town Environment Variables](https://www.val.town/settings/environment-variables).
24
25---

slackScoutmain.tsx3 matches

@kamathUpdated 4 months ago
54 query: topic,
55 pages: 2,
56 apiKey: Deno.env.get("BROWSERBASE_API_KEY") ?? "",
57 });
58}
63 maxResults: 10,
64 daysBack: 1,
65 apiKey: Deno.env.get("TWITTER_BEARER_TOKEN") ?? "",
66 });
67}
98
99 if (!response.ok) {
100 throw new Error(`Slack API error: ${response.status} ${response.statusText}`);
101 }
102

getShowcaseValsmain.tsx3 matches

@stevekrouseUpdated 4 months ago
77async function getScreenshot(url: string) {
78 const resp = await fetch(
79 "https://api.apiflash.com/v1/urltoimage?" + new URLSearchParams({
80 access_key: Deno.env.get("API_FLASH"),
81 url,
82 delay: "5",
90 const name = md5(url) + ".webp";
91 await blob.set(`__public/${name}`, await resp.arrayBuffer());
92 return `https://stevekrouse-blob_admin.web.val.run/api/public/${name}`;
93}
94

widemain.tsx7 matches

@maxmUpdated 4 months ago
1import { ValSession } from "https://esm.town/v/maxm/valSession";
2// import type { TSearchFilter, WideApi } from "https://esm.town/v/maxm/wideApi";
3type WideApi = any;
4type TSearchFilter = any;
5import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
7
8const { htmlUrl } = extractValInfo(import.meta.url);
9const _client = hc<WideApi>("https://maxm-wideapi.web.val.run/");
10
11export class Wide {
14 constructor(sessionToken: string) {
15 // TODO: can we use a global client?
16 this.#client = hc<WideApi>("https://maxm-wideapi.web.val.run/");
17 this.#sessionToken = sessionToken;
18 }
75
76export default async function(req: Request): Promise<Response> {
77 // Use your Val Town API Token to create a session
78 const wide = new Wide(await ValSession.new(Deno.env.get("valtown")));
79 await wide.write([{
98 <script>hljs.highlightAll();</script>
99 <style>
100 @import url('https://fonts.googleapis.com/css2?family=Kumbh+Sans:wght@900&family=Roboto+Mono:wght@400;700&display=swap');
101
102 * {
196import { Wide } from 'https://esm.town/v/maxm/wide';
197
198// Use your Val Town API Token to create a session
199const wide = new Wide(await ValSession.new(Deno.env.get("valtown")))
200

wideApimain.tsx1 match

@maxmUpdated 4 months ago
86});
87
88export type WideApi = typeof routes;
89
90export default app.fetch.bind(app);

mdxmain.tsx2 matches

@pomdtrUpdated 4 months ago
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { api } from "https://esm.town/v/pomdtr/api";
5import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
6import { gfm } from "https://esm.town/v/pomdtr/gfm";
28export function mdx(author: string, name: string) {
29 return async (req: Request) => {
30 const { readme } = await api(`/v1/alias/${author}/${name}`);
31 const vfile = await compile(readme, {
32 jsxImportSource: "https://esm.sh/preact",

cerebras_coderREADME.md2 matches

@nn6nUpdated 4 months ago
4
51. Sign up for [Cerebras](https://cloud.cerebras.ai/)
62. Get a Cerebras API Key
73. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`
8
9# Todos

cerebras_codermain.tsx1 match

@nn6nUpdated 4 months ago
9const STARTER_PROMPTS = [
10 "todo list app persisted in local storage",
11 "weather app using open-meteo API",
12 "interactive markdown editor with live preview",
13 "pomodoro timer with sound notifications",

blobReadPictureExamplemain.tsx2 matches

@adnanwahabUpdated 4 months ago
5 try {
6 // Use a public screenshot service that doesn't require authentication
7 const screenshotResponse = await fetch(`https://api.urlbox.io/v1/render/screenshot?url=${encodeURIComponent(url)}&width=1280&height=720`);
8
9 if (!screenshotResponse.ok) {
10 throw new Error(`Screenshot API error: ${screenshotResponse.status}`);
11 }
12

new-val-api-21 file match

@shouserUpdated 11 hours ago
This is an example of using the API to create a val.

gptApiTemplate2 file matches

@charmaineUpdated 1 day 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