> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polynode.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript REST Compatibility

> Use the current V3 client and understand the retained top-level V1/V2 methods.

Use `pn.v3` for new data integrations. It has the complete current route registry. The top-level `PolyNode` methods remain available for existing V1/V2 integrations and focused helpers such as health, legacy market search, and RPC.

```typescript theme={null}
import { PolyNode } from 'polynode-sdk';

const apiKey = process.env.POLYNODE_API_KEY;
if (!apiKey) throw new Error('Set POLYNODE_API_KEY');
const pn = new PolyNode({ apiKey });

// Current data surface
const stats = await pn.v3.stats();

// Retained compatibility helpers
const health = await pn.healthz();
const results = await pn.searchEvents('bitcoin', { limit: 5 });
const firstConditionId = results.events[0]?.markets[0]?.conditionId ?? null;

console.log({ stats, health, resultCount: results.events.length, firstConditionId });
```

Nested compatibility-search markets can omit `conditionId`. Treat it as optional and use a token ID or slug when your workflow requires an identifier.

Do not interpret the compatibility method list as the complete product API. For wallets, positions, grouped trades, combos, builders, credits, identities, profiles, webhooks, and perps, use [TypeScript V3](/sdks/ts/v3-data).

The generic JSON-RPC helper remains available as `pn.rpc(method, params)`. It is an HTTP request helper and does not implement `eth_subscribe`; use the [RPC guide](/sdks/rpc) for examples.
