API Reference
Labs API (JavaScript / TypeScript), v1
Client Options
| Option | Type | Default | Description |
|---|---|---|---|
| apiKey | string | - | Labs API key (or use LABS_API_KEY env var) |
| telemetry | { enabled?: boolean; sdkName?: string; sdkVersion?: string; } | { enabled: true } | SDK telemetry headers; set enabled=false to opt-out |
Methods
Public
TypeScript
1// List bots2await client.listBots({ limit: 10, sort: '-votes' });34// Get a bot by ID5await client.getBotById('123456789012345678');67// List users8await client.listUsers({ limit: 10, search: 'dev' });910// Website stats11await client.getWebsiteStats();
Authenticated
TypeScript
1// Post bot stats2await client.postStats({3 botId: '123456789012345678',4 guildCount: 1500,5 userCount: 250000,6 shardCount: 2,7});89// Get stats10await client.getStats({ botId: '123456789012345678', limit: 10 });
Generic helpers
TypeScript
1// GET /custom (no auth)2await client.get('/custom', { q: 'search' }, false);34// POST with auth5await client.post('/stats', { botId: '123456789012345678', guildCount: 1500 }, true);
Need more help?
Ask in our Discord or email support@conscherry.com.