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=14&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 15626 results for "api"(3013ms)

cerebras_coderREADME.md2 matches

@Rana882•Updated 19 hours ago
8
91. Sign up for [Cerebras](https://cloud.cerebras.ai/)
102. Get a Cerebras API Key
113. Save it in your project env variable called `CEREBRAS_API_KEY`

cerebras_coderindex.ts1 match

@Rana882•Updated 19 hours ago
211 } catch (error) {
212 Toastify({
213 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
214 position: "center",
215 duration: 3000,

cerebras_coderindex.html3 matches

@Rana882•Updated 19 hours ago
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>CerebrasCoder</title>
7 <link rel="preconnect" href="https://fonts.googleapis.com" />
8 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9 <link
10 href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
11 rel="stylesheet"
12 />
21 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
22 <meta property="og:type" content="website">
23 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
24
25

cerebras_codergenerate-code.ts1 match

@Rana882•Updated 19 hours ago
16 };
17 } else {
18 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
19 const completion = await client.chat.completions.create({
20 messages: [

fetch-socialsfetchBluesky.tsx1 match

@welson•Updated 19 hours ago
281 }
282
283 // Optional: Add a small delay to be respectful to the API
284 if (fetchFullHistory) {
285 await new Promise(resolve => setTimeout(resolve, 100));

fetch-socialsfetchMastodon.tsx2 matches

@welson•Updated 19 hours ago
23
24 // Step 1: Look up the account ID
25 const accountLookupUrl = `https://${MASTODON_INSTANCE}/api/v1/accounts/lookup?acct=${MASTODON_USERNAME}`;
26 console.log("Looking up account ID...");
27
37 // Step 2: Fetch recent posts (statuses)
38 const statusesUrl =
39 `https://${MASTODON_INSTANCE}/api/v1/accounts/${accountId}/statuses?limit=40&exclude_replies=true&exclude_reblogs=true`;
40 console.log("Fetching recent posts...");
41

flyFlyApiClient.ts13 matches

@chadparker•Updated 21 hours ago
1// Fly.io API client and HTTP endpoints
2import { Hono } from "https://esm.sh/hono@3.11.7";
3
9});
10
11// Types for Fly.io API responses
12interface FlyApp {
13 id: string;
47}
48
49// Base API client functions that can be imported by other files
50export class FlyApiClient {
51 private token: string;
52 private baseUrl = 'https://api.machines.dev/v1';
53
54 constructor() {
69
70 if (!response.ok) {
71 throw new Error(`Fly.io API error: ${response.status} ${response.statusText}`);
72 }
73
104app.get('/apps', async (c) => {
105 try {
106 const client = new FlyApiClient();
107 const orgSlug = c.req.query('org_slug') || 'personal';
108 const apps = await client.getApps(orgSlug);
115app.get('/apps/:appName', async (c) => {
116 try {
117 const client = new FlyApiClient();
118 const appName = c.req.param('appName');
119 const app = await client.getApp(appName);
126app.get('/apps/:appName/machines', async (c) => {
127 try {
128 const client = new FlyApiClient();
129 const appName = c.req.param('appName');
130 const machines = await client.getMachines(appName);
137app.get('/apps/:appName/machines/:machineId', async (c) => {
138 try {
139 const client = new FlyApiClient();
140 const appName = c.req.param('appName');
141 const machineId = c.req.param('machineId');
149app.get('/apps/:appName/machines/:machineId/events', async (c) => {
150 try {
151 const client = new FlyApiClient();
152 const appName = c.req.param('appName');
153 const machineId = c.req.param('machineId');
159});
160
161// Root endpoint with API documentation
162app.get('/', (c) => {
163 return c.json({
164 message: 'Fly.io API Proxy',
165 endpoints: {
166 'GET /apps': 'List all apps (optional ?org_slug=personal)',

flyindex.tsx2 matches

@chadparker•Updated 21 hours ago
1import { FlyApiClient } from "./FlyApiClient.ts";
2
3export default async function(req: Request): Promise<Response> {
4 try {
5 const client = new FlyApiClient();
6 const response = await client.getApps();
7 const apps = response.apps || [];

ContextualREADME.md2 matches

@c15r•Updated 22 hours ago
60- `BASE_URL`: Base URL for email verification links (optional)
61
62## API Endpoints
63
64- `GET /` - API documentation and status
65- `GET /health` - Health check endpoint
66- `POST /register` - User registration (no auth required)

ChatApp.tsx8 matches

@c15r•Updated 22 hours ago
19
20export interface AppConfig {
21 anthropicApiKey: string;
22 mcpServers: MCPServer[];
23 selectedModel: string;
36export default function App() {
37 const [config, setConfig] = useState<AppConfig>({
38 anthropicApiKey: "",
39 mcpServers: DEFAULT_MCP_SERVERS,
40 selectedModel: "claude-3-5-sonnet-20241022",
45 // Load config from localStorage on mount
46 useEffect(() => {
47 const savedApiKey = localStorage.getItem("anthropic_api_key");
48 const savedMcpServers = localStorage.getItem("mcp_servers");
49 const savedMessages = localStorage.getItem("chat_messages");
51
52 setConfig({
53 anthropicApiKey: savedApiKey || "",
54 mcpServers: savedMcpServers ? JSON.parse(savedMcpServers) : DEFAULT_MCP_SERVERS,
55 selectedModel: savedModel || "claude-3-5-sonnet-20241022",
66 }
67
68 // Show settings if no API key is configured
69 if (!savedApiKey) {
70 setShowSettings(true);
71 }
74 // Save config to localStorage when it changes
75 useEffect(() => {
76 if (config.anthropicApiKey) {
77 localStorage.setItem("anthropic_api_key", config.anthropicApiKey);
78 }
79 localStorage.setItem("mcp_servers", JSON.stringify(config.mcpServers));

googleGeminiAPI2 file matches

@michaelwschultz•Updated 4 hours ago

HN-fetch-call2 file matches

@ImGqb•Updated 3 days ago
fetch HackerNews by API
Kapil01
apiv1