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/$1?q=api&page=32&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 18182 results for "api"(1472ms)

Discord-to-Linearmain.tsx3 matches

@hussufo•Updated 2 days ago
1import { blob } from "https://esm.town/v/std/blob";
2import { CONFIG } from "./backend/config.tsx";
3import { DiscordAPI } from "./backend/discord.tsx";
4import { LinearSDK } from "./backend/linear.tsx";
5
24
25 // Initialize services
26 const discord = new DiscordAPI();
27 const linear = new LinearSDK();
28
45 */
46async function processChannelReactions(
47 discord: DiscordAPI,
48 linear: LinearSDK,
49 serverId: string,

Discord-to-Linearlinear.tsx1 match

@hussufo•Updated 2 days ago
6
7 constructor() {
8 this.client = new LinearClient({ apiKey: Deno.env.get("LINEAR_API_KEY")! });
9 }
10

PlaywrightDemomain.ts3 matches

@hussufo•Updated 2 days ago
3import { Browser } from "npm:playwright-core";
4import { valTownChromium } from "./valTownChromium.ts";
5import { STEEL_API_KEY } from "./consts.ts";
6import { hackerNewsDemo } from "./hackerNewsDemo.ts";
7
8const client = new Steel({
9 steelAPIKey: STEEL_API_KEY,
10});
11
19
20 browser = await valTownChromium.connectOverCDP(
21 `wss://connect.steel.dev?apiKey=${STEEL_API_KEY}&sessionId=${session.id}`,
22 { slowMo: 0 },
23 );

PlaywrightDemoconsts.ts1 match

@hussufo•Updated 2 days ago
1export const STEEL_API_KEY = Deno.env.get("STEEL_API_KEY");
2

weatherWeatherMap.tsx13 matches

@dukky•Updated 2 days ago
17export default function WeatherMap({ onLocationSelect, selectedLocation }: WeatherMapProps) {
18 const mapRef = useRef<HTMLDivElement>(null);
19 const mapInstanceRef = useRef<any>(null);
20 const markersRef = useRef<any[]>([]);
21 const selectedMarkerRef = useRef<any>(null);
29 // Create map centered on UK
30 const map = window.L.map(mapRef.current).setView([54.5, -2], 3);
31 mapInstanceRef.current = map;
32
33 // Add OpenStreetMap tiles
46
47 return () => {
48 if (mapInstanceRef.current) {
49 mapInstanceRef.current.remove();
50 mapInstanceRef.current = null;
51 }
52 if (selectedMarkerRef.current) {
58 // Zoom to selected location when it changes
59 useEffect(() => {
60 if (!mapInstanceRef.current || !selectedLocation) return;
61
62 const { latitude, longitude } = selectedLocation;
64 // Remove previous selected location marker
65 if (selectedMarkerRef.current) {
66 mapInstanceRef.current.removeLayer(selectedMarkerRef.current);
67 selectedMarkerRef.current = null;
68 }
69
70 // Zoom to the selected location with a nice animation
71 mapInstanceRef.current.setView([latitude, longitude], 12, {
72 animate: true,
73 duration: 1.0
102 icon: selectedIcon,
103 zIndexOffset: 1000 // Ensure it appears above other markers
104 }).addTo(mapInstanceRef.current);
105
106 }, [selectedLocation]);
108 // Update markers when weather data changes
109 useEffect(() => {
110 if (!mapInstanceRef.current || !window.L) return;
111
112 // Clear existing markers
113 markersRef.current.forEach(marker => {
114 mapInstanceRef.current.removeLayer(marker);
115 });
116 markersRef.current = [];
147 const marker = window.L.marker([point.latitude, point.longitude], {
148 icon: customIcon
149 }).addTo(mapInstanceRef.current);
150
151 // Add popup with detailed info
192 try {
193 setLoading(true);
194 const response = await fetch('/api/weather/map');
195 if (response.ok) {
196 const data = await response.json();

linearStandupmain.tsx9 matches

@kitimborino•Updated 2 days ago
57
58export async function exec(interval: Interval) {
59 const apiKey = Deno.env.get("LINEAR_API_KEY");
60 if (!apiKey) {
61 console.error("LINEAR_API_KEY not found in environment variables");
62 Deno.exit(1);
63 }
65 const { startDate, endDate } = getYesterdayDateRange();
66
67 const response = await fetch("https://api.linear.app/graphql", {
68 method: "POST",
69 headers: {
70 "Content-Type": "application/json",
71 Authorization: apiKey,
72 },
73 body: JSON.stringify({
80
81 if (data.errors) {
82 console.error("Error fetching data from Linear API:", data.errors);
83 Deno.exit(1);
84 }
94 }
95
96 const historyResponse = await fetch("https://api.linear.app/graphql", {
97 method: "POST",
98 headers: {
99 "Content-Type": "application/json",
100 Authorization: apiKey,
101 },
102 body: JSON.stringify({
190 }
191
192 const slackResponse = await fetch("https://slack.com/api/chat.postMessage", {
193 method: "POST",
194 headers: {

autonomous-valtools.tsx4 matches

@charmaine•Updated 2 days ago
77 }),
78 execute: async ({ query }) => {
79 const apiKey = Deno.env.get("EXA_API_KEY");
80 const exa = new Exa(apiKey);
81 const result = await exa.searchAndContents(query, {
82 text: true,
100 }),
101 execute: async ({ url }) => {
102 const apiKey = Deno.env.get("EXA_API_KEY");
103 const exa = new Exa(apiKey);
104 const result = await exa.getContents([url], { text: true });
105 return {

autonomous-valREADME.md9 matches

@charmaine•Updated 2 days ago
1# Autonomous Val
2This project demonstrates how to build autonomous agents on Val Town that can be triggered by API calls, cron jobs, etc.
3
4![Screenshot 2025-05-29 at 8.03.54 PM.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/8d53ae11-7cc7-415d-9a2d-edd9c66c5500/public)
8
9Configure the following variables in your environment:
10- `AGENT_API_KEY` (This is a secure token that you choose to secure the agent.tsx POST endpoint)
11- `OPENAI_API_KEY` (An OpenAI API Key)
12- `EXA_API_KEY` (Optional, though needed if you use the web search tool)
13
14## Usage
15Use `demo.tsx` to send objectives to your agent.
16
17### API Usage
18To use the API from another client, you can POST authenticated requests to the agent.tsx endpoint:
19
20```javascript
30 headers: {
31 "Content-Type": "application/json",
32 "Authorization": `Bearer ${Deno.env.get("AGENT_API_KEY")}`,
33 },
34 body: JSON.stringify(requestBody),
37
38### Streaming Chat
39The API will also work with streaming chat front ends based on the Vercel AI SDK's useChat hook.
40
41You just need to pass `streamResults: true` in your API POST request.
42
43## Using Other Models

autonomous-valdiagram.tsx1 match

@charmaine•Updated 2 days ago
5 linkStyle default stroke:#aaaaaa,stroke-width:1.5px
6
7 API[API] <--> Agent
8
9 subgraph "Agent Runtime"

autonomous-valdemo.tsx5 matches

@charmaine•Updated 2 days ago
22 objective = formData.get("objective")?.toString() || objective;
23
24 // Continue with API call using the submitted objective
25 } else {
26 return new Response("Unsupported content type", { status: 415 });
27 }
28
29 // Make API call with the objective from the form
30 const requestBody = {
31 messages: [
40 headers: {
41 "Content-Type": "application/json",
42 "Authorization": `Bearer ${Deno.env.get("AGENT_API_KEY")}`,
43 },
44 body: JSON.stringify(requestBody),
50 }
51
52 // Get the API response data
53 const responseData = await response.json();
54 console.log("API Response:", responseData);
55
56 // Return HTML with the results

xxxclearinghouse_validator

@toowired•Updated 8 hours ago
Request validator for clearance API

Apiify11 file matches

@wolf•Updated 1 day ago
Kapil01
apiv1