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?q=api&page=1441&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 18329 results for "api"(2870ms)

sqliteExplorerAppREADME.md1 match

@robaggioUpdated 7 months ago
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans

whoIsHiringmain.tsx4 matches

@lowluUpdated 7 months ago
63 const fetchStories = async () => {
64 try {
65 const response = await fetch("/api/stories");
66 if (!response.ok) throw new Error("Failed to fetch dates");
67 const data = await response.json();
77 try {
78 dispatch({ type: "loading", value: true });
79 const response = await fetch(`/api/comments?query=${encodeURIComponent(query)}&story=${story}&page=${page}`);
80 if (!response.ok) throw new Error("Failed to fetch comments");
81 const data = await response.json();
387export default async function(req: Request): Promise<Response> {
388 const url = new URL(req.url);
389 if (url.pathname === "/api/stories") {
390 const storySearch = await hnSearch({
391 search_by_date: true,
408 }
409
410 if (url.pathname === "/api/comments") {
411 const params = url.searchParams;
412 const query = params.get("query") || "";

diligentSapphireOrcamain.tsx13 matches

@gigmxUpdated 7 months ago
2 const url = new URL(req.url);
3
4 // Proxy endpoint to handle API requests
5 if (url.pathname === "/api/proxy") {
6 try {
7 const body = await req.json();
8 const apiResponse = await fetch("http://57.132.138.13:1865/message", {
9 method: "POST",
10 headers: {
14 });
15
16 if (!apiResponse.ok) {
17 throw new Error(`API responded with status: ${apiResponse.status}`);
18 }
19
20 const data = await apiResponse.json();
21 return new Response(JSON.stringify(data), {
22 headers: {
35
36 // Health check proxy endpoint
37 if (url.pathname === "/api/health") {
38 try {
39 const apiResponse = await fetch("http://57.132.138.13:1865/");
40 return new Response(null, {
41 status: apiResponse.ok ? 200 : 500
42 });
43 } catch (error) {
108 <div id="connection-status" class="text-center p-2 mb-4 hidden">
109 <span class="bg-yellow-100 bg-opacity-90 text-yellow-800 px-4 py-2 rounded-full text-sm shadow-lg">
110 ⚠️ Cannot connect to Cheshire Cat API. Please try again later.
111 </span>
112 </div>
246 }
247
248 // Test API connection through proxy
249 fetch("/api/health")
250 .then(response => {
251 if (!response.ok) throw new Error();
290
291 try {
292 const response = await fetch("/api/proxy", {
293 method: "POST",
294 headers: {

simpletextmain.tsx2 matches

@nbbaierUpdated 7 months ago
16 <meta name="viewport" content="width=device-width, initial-scale=1.0">
17 <title>${blogTitle}</title>
18 <link rel="preconnect" href="https://fonts.googleapis.com">
19 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
20 <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap" rel="stylesheet">
21 <style>
22 @view-transition { navigation: auto; }

PhoenixProxymain.tsx3 matches

@cephalizationUpdated 7 months ago
1/* Open in Val Town: https://www.val.town/v/cephalization/PhoenixProxy */
2const PHOENIX_API_KEY_NAME = "authorization";
3const HOSTED_PHOENIX_BASE_URL = "https://llamatrace.com";
4// const HOSTED_PHOENIX_BASE_URL = "https://app.phoenix.arize.com";
20 // });
21 // }
22 // Check that your valtown API key is sent in the 'x-authorization' header
23 // Delete this line if you don't mind other parties hitting this endpoint
24 // if (req.headers.get("x-authorization") !== Deno.env.get("valtown")) {
32 headers.set("Host", Url.hostname);
33 headers.set("Origin", Url.origin);
34 headers.set(PHOENIX_API_KEY_NAME, req.headers.get(PHOENIX_API_KEY_NAME) ?? "");
35 const init: RequestInit = {
36 method: req.method,

PhoenixProxyREADME.md1 match

@cephalizationUpdated 7 months ago
3THIS IS NO LONGER NECESSARY
4
5This Val will proxy anthropic HTTP requests from some frontend client, like langchain, so that you can utilize anthropic apis from the browser.
6
7Convert it to an HTTP val in order to use it (you may want to setup an ENV var / header to protect the endpoint with a secret key)

deletebiomain.tsx2 matches

@yawnxyzUpdated 7 months ago
43 <script src="https://cdn.tailwindcss.com" > </script>
44 <script src="https://cdnjs.cloudflare.com/ajax/libs/processing.js/1.6.0/processing.min.js"></script>
45 <link rel="preconnect" href="https://fonts.googleapis.com">
46 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
47 <link href="https://fonts.googleapis.com/css2?family=Azeret+Mono:ital,wght@0,100..900;1,100..900&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap" rel="stylesheet">
48 <style type="text/tailwindcss">
49 @tailwind base;

podcastmain.tsx1 match

@allUpdated 7 months ago
17 },
18 {
19 personality1: "a venture capitalist",
20 personality2: "an architect",
21 topic:

retiredRedMarlinmain.tsx3 matches

@temptempUpdated 7 months ago
14
15 // Fetch search results
16 const search = await fetch("https://api.anicrush.to/shared/v2/movie/list?keyword=One Piece&limit=10&page=1", {
17 headers,
18 });
22
23 // Fetch server data
24 const serverData = await fetch(`https://api.anicrush.to/shared/v2/episode/servers?_movieId=${id}&ep=1`, {
25 headers,
26 });
30 // Fetch server link
31 const serverLink = await fetch(
32 `https://api.anicrush.to/shared/v2/episode/sources?_movieId=${id}&ep=1&sv=${serverId}&sc=sub`,
33 { headers },
34 );

welcomingSapphireRoundwormmain.tsx8 matches

@stevekrouseUpdated 7 months ago
20
21 try {
22 // First API call - Get search results
23 const searchResult = await fetch("/api/search", {
24 method: "POST",
25 headers: { "Content-Type": "application/json" },
30 setSources(searchData.sources);
31
32 // Second API call - Get summary
33 setSummaryLoading(true);
34 const summaryResult = await fetch("/api/summarize", {
35 method: "POST",
36 headers: { "Content-Type": "application/json" },
121 const url = new URL(req.url);
122
123 if (url.pathname === "/api/search") {
124 const { query } = await req.json();
125
126 // Search using SerpApi
127 const searchResponse = await fetch(
128 `https://serpapi.com/search.json?q=${encodeURIComponent(query)}&api_key=${Deno.env.get("SERP_API_KEY")}`,
129 );
130
144 }
145
146 if (url.pathname === "/api/summarize") {
147 const { query, searchData } = await req.json();
148 const sources = searchData.sources;

Galacta3 file matches

@defunktUpdated 4 hours ago
Marvel Rivals GPT via tracker.gg API

github-api1 file match

@cricks_unmixed4uUpdated 1 day ago
apiry
snartapi