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

# Chainworks API

> Overview of the Chainworks unified DeFi API, available over Socket.IO and HTTP, across Solana, Ethereum, Base, and BNB Chain.

Welcome to the Chainworks API documentation. Build powerful DeFi applications with our unified API, available over both Socket.IO and HTTP.

***

## What is Chainworks?

Chainworks provides a **unified DeFi API** that enables developers and institutions to easily access trading, token analysis, and other DeFi functionality across multiple blockchains.

The same operations are available over two transports:

* **Socket.IO** for a persistent, low-latency connection with real-time push (for example live price updates).
* **HTTP** for simple, stateless request and response calls.

Every event path is also an HTTP endpoint. The request body and response shape are identical across transports, so you can pick whichever fits your stack. See [Quick Start](/quickstart) and [Authentication](/authentication) for both.

***

## Supported Chains

| Chain     | Identifier | Type | Native Token |
| --------- | ---------- | ---- | ------------ |
| Ethereum  | `eth`      | EVM  | ETH          |
| Base      | `base`     | EVM  | ETH          |
| BNB Chain | `bsc`      | EVM  | BNB          |
| Solana    | `sol`      | SVM  | SOL          |

***

## Core Features

### Token Trading

Execute swaps across multiple DEXes with optimal routing. Get quotes, build transactions, and send them with MEV protection.

### Price Quotes

Real-time price quotes with slippage calculation, price impact analysis, and liquidity information.

### Token Reports

Comprehensive token analysis including:

* Liquidity depth
* Buy/sell taxes
* Transfer limits
* Holder restrictions
* Market data

### Multi-Chain Transfers

Build and send native currency and token transfers across all supported chains.

***

## Quick Example

<Tabs>
  <Tab title="Socket.IO">
    ```typescript theme={null}
    import { io } from "socket.io-client";

    const socket = io(CHAINWORKS_API_URL, {
      transports: ["websocket"],
      auth: { token: CHAINWORKS_API_AUTH_TOKEN },
    });

    socket.on("connect", () => {
      console.log("Connected to Chainworks API");

      // Get a buy quote
      socket.emit("/evm/buy/quote", {
        chain: "eth",
        token: "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
        swapMode: "ExactIn",
        amountIn: "1000000000000000000",
        wallet: "0xYourWallet",
      });
    });

    socket.on("/evm/buy/quote", (response) => {
      if (response.success) {
        console.log("Price:", response.result.price);
      }
    });
    ```
  </Tab>

  <Tab title="HTTP">
    ```typescript theme={null}
    // Get a buy quote
    const res = await fetch(`${CHAINWORKS_API_URL}/evm/buy/quote`, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Authorization: CHAINWORKS_API_AUTH_TOKEN,
      },
      body: JSON.stringify({
        chain: "eth",
        token: "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
        swapMode: "ExactIn",
        amountIn: "1000000000000000000",
        wallet: "0xYourWallet",
      }),
    });

    const response = await res.json();
    if (response.success) {
      console.log("Price:", response.result.price);
    }
    ```
  </Tab>
</Tabs>

***

## Next Steps

* **[Quick Start](/quickstart)** - Set up your environment and make your first request
* **[Authentication](/authentication)** - Learn how to connect with your credentials
* **[EVM Endpoints](/evm/overview)** - Explore Ethereum, Base, and BSC APIs
* **[SVM Endpoints](/svm/overview)** - Explore Solana APIs
* **[FAQ](/faq)** - Answers to common questions
* **[Playground](https://chainworks.co/playground)** - Test the API interactively
