Skip to main content
Get up and running with the Chainworks API in just a few minutes.

Prerequisites

  • Node.js 18+ or Python 3.8+
  • Chainworks API credentials (API URL and Auth Token)
  • Basic understanding of either Socket.IO or HTTP requests

Choosing a Transport

The Chainworks API exposes the same operations over two transports:
  • Socket.IO keeps a persistent, bidirectional connection with low latency and real-time push (for example live price updates). Pick this for streaming or high-frequency trading.
  • HTTP is stateless request and response. Pick this for simple integrations or when you cannot hold an open connection.
The request body and response shape are identical across transports, so the examples below show both. Use the toggle to switch.

Installation

The Socket.IO transport needs a client library. The HTTP transport works with any HTTP client (the built-in fetch in JavaScript, or requests in Python), so it needs no SDK.

Connecting to the API

Socket.IO opens a persistent connection and authenticates once during the handshake.

Your First Request

Let’s get a buy quote for a token on Ethereum:

Response Format

Both transports return the same response shape:

Success Response

Error Response

Next Steps