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=961&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 13543 results for "api"(1257ms)

forbearingAmethystToadmain.tsx2 matches

@vawogbemi•Updated 6 months ago
421 if (url.pathname === "/create-checkout-session" && req.method === "POST") {
422 const stripe = new Stripe(Deno.env.get("STRIPE_VALTOWN_SECRET_KEY"), {
423 apiVersion: "2022-11-15",
424 });
425
460
461 const stripe = new Stripe(Deno.env.get("STRIPE_VALTOWN_SECRET_KEY"), {
462 apiVersion: "2022-11-15",
463 });
464

sendxmpplibREADME.md1 match

@singpolyma•Updated 6 months ago
1Simple helper for sending a message over XMPP. For an API that doesn't require your own bot setup see https://www.val.town/v/singpolyma/sendxmpp
2
3```js

fluentAmberHyenamain.tsx3 matches

@deepmojo•Updated 6 months ago
13 setError("");
14 try {
15 const res = await fetch(`${window.location.href}api/map`, {
16 method: "POST",
17 headers: {
103 const url = new URL(req.url);
104
105 if (req.method === "POST" && url.pathname === "/api/map") {
106 const { domain } = await req.json();
107 if (!domain) {
110
111 try {
112 const response = await fetch("https://api.firecrawl.dev/v1/map", {
113 method: "POST",
114 headers: {

browserbasePuppeteerExamplemain.tsx1 match

@moe•Updated 6 months ago
2
3const browser = await puppeteer.connect({
4 browserWSEndpoint: `wss://connect.browserbase.com?apiKey=${Deno.env.get("BROWSERBASE_API_KEY")}`,
5})
6

efficientWhiteBobolinkmain.tsx3 matches

@deepmojo•Updated 6 months ago
13 setError("");
14 try {
15 const res = await fetch(`${window.location.origin}/api`, {
16 method: 'POST',
17 headers: {
123 const url = new URL(req.url);
124
125 if (req.method === "POST" && url.pathname === "/api") {
126 try {
127 const { domain } = await req.json();
130 }
131
132 const firecrawlResponse = await fetch("https://api.firecrawl.dev/v1/map", {
133 method: "POST",
134 headers: {

evaltownWorkermain.tsx3 matches

@deepmojo•Updated 6 months ago
26 setError("");
27 try {
28 const res = await fetch(`${window.location.href}api?city=${encodeURIComponent(city)}`);
29 const data = await res.json();
30 if (data.error) {
159 const url = new URL(req.url);
160
161 if (req.method === "GET" && url.pathname === "/api") {
162 const city = url.searchParams.get("city");
163 if (!city) {
167 try {
168 const weatherUrl =
169 `https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41&current_weather=true&daily=temperature_2m_max,weathercode&timezone=auto&forecast_days=5`;
170 const weatherRes = await fetch(weatherUrl);
171 const weatherData = await weatherRes.json();

rabbitstreammain.tsx1 match

@temptemp•Updated 6 months ago
16 const { provider, id } = c.req.param();
17 if (!["rabbit", "mega"].includes(provider)) {
18 return c.json({ error: "Invalid API request" }, 500);
19 }
20 // const cache = await blob.getJSON(id);

graphqlAPIEndpointREADME.md1 match

@flesch•Updated 6 months ago
1Migrated from folder: GraphQL/graphqlAPIEndpoint

falDemoAppmain.tsx2 matches

@gratitude5dee•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 }

otherBrokenURLhandlermain.tsx2 matches

@willthereader•Updated 6 months ago
71 `;
72
73 console.log(`Making LSD API request for ${pageUrl}...`);
74 const response = await fetch(
75 `https://lsd.so/api?query=${encodeURIComponent(query)}`
76 );
77

create-val-api-demo1 file match

@shouser•Updated 4 hours ago

new-val-api-demo

@shouser•Updated 4 hours ago
This is an example of using the API to create a val.
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com
mux
Your friendly, neighborhood video API.