CC

CCXT library support for Go developers to interact with cryptocurrency exchanges via REST and WebSocket APIs.

Install

mkdir -p .claude/skills/ccxt-go && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4151" && unzip -o skill.zip -d .claude/skills/ccxt-go && rm skill.zip

Installs to .claude/skills/ccxt-go

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

CCXT cryptocurrency exchange library for Go developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in Go projects. Use when working with crypto exchanges in Go applications, microservices, or trading systems.
376 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Connect to crypto exchanges
  • Fetch market data (tickers, orderbooks)
  • Place limit and market orders
  • Stream real-time data via WebSockets
  • Manage authentication and errors

How it works

The library provides a unified interface for both REST and WebSocket APIs across multiple cryptocurrency exchanges, abstracting exchange-specific differences into common Go methods.

Inputs & outputs

You give it
Exchange symbol or trading parameters
You get back
Market data or order execution status

When to use ccxt-go

  • Fetching crypto market tickers
  • Placing automated orders
  • Streaming live orderbooks
  • Building trading bots

About this skill

CCXT for Go

A comprehensive guide to using CCXT in Go projects for cryptocurrency exchange integration.

Installation

REST API

go get github.com/ccxt/ccxt/go/v4

WebSocket API (ccxt.pro)

go get github.com/ccxt/ccxt/go/v4/pro

Quick Start

REST API

package main

import (
    "fmt"
    "github.com/ccxt/ccxt/go/v4/binance"
)

func main() {
    exchange := binance.New()
    markets, err := exchange.LoadMarkets()
    if err != nil {
        panic(err)
    }

    ticker, err := exchange.FetchTicker("BTC/USDT")
    if err != nil {
        panic(err)
    }

    fmt.Println(ticker)
}

WebSocket API - Real-time Updates

package main

import (
    "fmt"
    "github.com/ccxt/ccxt/go/v4/pro/binance"
)

func main() {
    exchange := binance.New()
    defer exchange.Close()

    for {
        ticker, err := exchange.WatchTicker("BTC/USDT")
        if err != nil {
            panic(err)
        }
        fmt.Println(ticker.Last)  // Live updates!
    }
}

REST vs WebSocket

FeatureREST APIWebSocket API
Use forOne-time queries, placing ordersReal-time monitoring, live price feeds
Importgithub.com/ccxt/ccxt/go/v4/{exchange}github.com/ccxt/ccxt/go/v4/pro/{exchange}
MethodsFetch* (FetchTicker, FetchOrderBook)Watch* (WatchTicker, WatchOrderBook)
SpeedSlower (HTTP request/response)Faster (persistent connection)
Rate limitsStrict (1-2 req/sec)More lenient (continuous stream)
Best forTrading, account managementPrice monitoring, arbitrage detection

Important: All methods return (result, error) - always check errors!

Creating Exchange Instance

REST API

import "github.com/ccxt/ccxt/go/v4/binance"

// Public API (no authentication)
exchange := binance.New()
exchange.EnableRateLimit = true  // Recommended!

// Private API (with authentication)
exchange := binance.New()
exchange.ApiKey = "YOUR_API_KEY"
exchange.Secret = "YOUR_SECRET"
exchange.EnableRateLimit = true

WebSocket API

import "github.com/ccxt/ccxt/go/v4/pro/binance"

// Public WebSocket
exchange := binance.New()
defer exchange.Close()

// Private WebSocket (with authentication)
exchange := binance.New()
exchange.ApiKey = "YOUR_API_KEY"
exchange.Secret = "YOUR_SECRET"
defer exchange.Close()

Common REST Operations

Loading Markets

// Load all available trading pairs
markets, err := exchange.LoadMarkets()
if err != nil {
    panic(err)
}

// Access market information
btcMarket := exchange.Market("BTC/USDT")
fmt.Println(btcMarket.Limits.Amount.Min)  // Minimum order amount

Fetching Ticker

// Single ticker
ticker, err := exchange.FetchTicker("BTC/USDT")
if err != nil {
    panic(err)
}
fmt.Println(ticker.Last)      // Last price
fmt.Println(ticker.Bid)       // Best bid
fmt.Println(ticker.Ask)       // Best ask
fmt.Println(ticker.Volume)    // 24h volume

// Multiple tickers (if supported)
tickers, err := exchange.FetchTickers([]string{"BTC/USDT", "ETH/USDT"})

Fetching Order Book

// Full orderbook
orderbook, err := exchange.FetchOrderBook("BTC/USDT", nil)
if err != nil {
    panic(err)
}
fmt.Println(orderbook.Bids[0])  // [price, amount]
fmt.Println(orderbook.Asks[0])  // [price, amount]

// Limited depth
limit := 5
orderbook, err := exchange.FetchOrderBook("BTC/USDT", &limit)

Creating Orders

Limit Order

// Buy limit order
order, err := exchange.CreateLimitBuyOrder("BTC/USDT", 0.01, 50000, nil)
if err != nil {
    panic(err)
}
fmt.Println(order.Id)

// Sell limit order
order, err := exchange.CreateLimitSellOrder("BTC/USDT", 0.01, 60000, nil)

// Generic limit order
order, err := exchange.CreateOrder("BTC/USDT", "limit", "buy", 0.01, 50000, nil)

Market Order

// Buy market order
order, err := exchange.CreateMarketBuyOrder("BTC/USDT", 0.01, nil)

// Sell market order
order, err := exchange.CreateMarketSellOrder("BTC/USDT", 0.01, nil)

// Generic market order
order, err := exchange.CreateOrder("BTC/USDT", "market", "sell", 0.01, nil, nil)

Fetching Balance

balance, err := exchange.FetchBalance()
if err != nil {
    panic(err)
}
fmt.Println(balance["BTC"].Free)   // Available balance
fmt.Println(balance["BTC"].Used)   // Balance in orders
fmt.Println(balance["BTC"].Total)  // Total balance

Fetching Orders

// Open orders
openOrders, err := exchange.FetchOpenOrders("BTC/USDT", nil, nil, nil)

// Closed orders
closedOrders, err := exchange.FetchClosedOrders("BTC/USDT", nil, nil, nil)

// All orders (open + closed)
allOrders, err := exchange.FetchOrders("BTC/USDT", nil, nil, nil)

// Single order by ID
order, err := exchange.FetchOrder(orderId, "BTC/USDT", nil)

Fetching Trades

// Recent public trades
limit := 10
trades, err := exchange.FetchTrades("BTC/USDT", nil, &limit, nil)

// Your trades (requires authentication)
myTrades, err := exchange.FetchMyTrades("BTC/USDT", nil, nil, nil)

Canceling Orders

// Cancel single order
err := exchange.CancelOrder(orderId, "BTC/USDT", nil)

// Cancel all orders for a symbol
err := exchange.CancelAllOrders("BTC/USDT", nil)

WebSocket Operations (Real-time)

Watching Ticker (Live Price Updates)

import "github.com/ccxt/ccxt/go/v4/pro/binance"

exchange := binance.New()
defer exchange.Close()

for {
    ticker, err := exchange.WatchTicker("BTC/USDT")
    if err != nil {
        panic(err)
    }
    fmt.Println(ticker.Last, ticker.Timestamp)
}

Watching Order Book (Live Depth Updates)

exchange := binance.New()
defer exchange.Close()

for {
    orderbook, err := exchange.WatchOrderBook("BTC/USDT", nil)
    if err != nil {
        panic(err)
    }
    fmt.Println("Best bid:", orderbook.Bids[0])
    fmt.Println("Best ask:", orderbook.Asks[0])
}

Watching Trades (Live Trade Stream)

exchange := binance.New()
defer exchange.Close()

for {
    trades, err := exchange.WatchTrades("BTC/USDT", nil, nil, nil)
    if err != nil {
        panic(err)
    }
    for _, trade := range trades {
        fmt.Println(trade.Price, trade.Amount, trade.Side)
    }
}

Watching Your Orders (Live Order Updates)

exchange := binance.New()
exchange.ApiKey = "YOUR_API_KEY"
exchange.Secret = "YOUR_SECRET"
defer exchange.Close()

for {
    orders, err := exchange.WatchOrders("BTC/USDT", nil, nil, nil)
    if err != nil {
        panic(err)
    }
    for _, order := range orders {
        fmt.Println(order.Id, order.Status, order.Filled)
    }
}

Watching Balance (Live Balance Updates)

exchange := binance.New()
exchange.ApiKey = "YOUR_API_KEY"
exchange.Secret = "YOUR_SECRET"
defer exchange.Close()

for {
    balance, err := exchange.WatchBalance()
    if err != nil {
        panic(err)
    }
    fmt.Println("BTC:", balance["BTC"])
    fmt.Println("USDT:", balance["USDT"])
}

Complete Method Reference

Market Data Methods

Tickers & Prices

  • fetchTicker(symbol) - Fetch ticker for one symbol
  • fetchTickers([symbols]) - Fetch multiple tickers at once
  • fetchBidsAsks([symbols]) - Fetch best bid/ask for multiple symbols
  • fetchLastPrices([symbols]) - Fetch last prices
  • fetchMarkPrices([symbols]) - Fetch mark prices (derivatives)

Order Books

  • fetchOrderBook(symbol, limit) - Fetch order book
  • fetchOrderBooks([symbols]) - Fetch multiple order books
  • fetchL2OrderBook(symbol) - Fetch level 2 order book
  • fetchL3OrderBook(symbol) - Fetch level 3 order book (if supported)

Trades

  • fetchTrades(symbol, since, limit) - Fetch public trades
  • fetchMyTrades(symbol, since, limit) - Fetch your trades (auth required)
  • fetchOrderTrades(orderId, symbol) - Fetch trades for specific order

OHLCV (Candlesticks)

  • fetchOHLCV(symbol, timeframe, since, limit) - Fetch candlestick data
  • fetchIndexOHLCV(symbol, timeframe) - Fetch index price OHLCV
  • fetchMarkOHLCV(symbol, timeframe) - Fetch mark price OHLCV
  • fetchPremiumIndexOHLCV(symbol, timeframe) - Fetch premium index OHLCV

Account & Balance

  • fetchBalance() - Fetch account balance (auth required)
  • fetchAccounts() - Fetch sub-accounts
  • fetchLedger(code, since, limit) - Fetch ledger history
  • fetchLedgerEntry(id, code) - Fetch specific ledger entry
  • fetchTransactions(code, since, limit) - Fetch transactions
  • fetchDeposits(code, since, limit) - Fetch deposit history
  • fetchWithdrawals(code, since, limit) - Fetch withdrawal history
  • fetchDepositsWithdrawals(code, since, limit) - Fetch both deposits and withdrawals

Trading Methods

Creating Orders

  • createOrder(symbol, type, side, amount, price, params) - Create order (generic)
  • createLimitOrder(symbol, side, amount, price) - Create limit order
  • createMarketOrder(symbol, side, amount) - Create market order
  • createLimitBuyOrder(symbol, amount, price) - Buy limit order
  • createLimitSellOrder(symbol, amount, price) - Sell limit order
  • createMarketBuyOrder(symbol, amount) - Buy market order
  • createMarketSellOrder(symbol, amount) - Sell market order
  • createMarketBuyOrderWithCost(symbol, cost) - Buy with specific cost
  • createStopLimitOrder(symbol, side, amount, price, stopPrice) - Stop-limit order
  • createStopMarketOrder(symbol, side, amount, stopPrice) - Stop-market order
  • createStopLossOrder(symbol, side, amount, stopPrice) - Stop-loss order
  • createTakeProfitOrder(symbol, side, amount, takeProfitPrice) - Take-profit order
  • createTrailingAmountOrder(symbol, side, amount, trailingAmount) - Trailing stop
  • createTrailingPercentOrder(symbol, side, amount, trailingPercent) - Trailing stop %
  • createTriggerOrder(symbol, side, amount, triggerPrice) - Trigger order
  • createPostOnlyOrder(symbol, side, amount, price) - Post-only order
  • createReduceOnlyOrder(symbol, side, amount, price) - Reduce-only order
  • createOrders([orders])

Content truncated.

When not to use it

  • When working with non-crypto financial markets
  • When low-latency requirements exceed WebSocket capabilities

Prerequisites

Go development environmentExchange API keys (for private operations)

Limitations

  • Rate limits vary by exchange
  • Requires careful handling of WebSocket connections
  • Symbol formats must follow CCXT conventions

How it compares

It provides a unified, standardized API for multiple exchanges, eliminating the need to write custom integration code for each platform.

Compared to similar skills

ccxt-go side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
ccxt-go (this skill)16moReviewIntermediate
templ-htmx37moNo flagsIntermediate
generating-grpc-services127dReviewAdvanced
higress-wasm-go-plugin16moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

ccxt-csharp

ccxt

CCXT cryptocurrency exchange library for C# and .NET developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in .NET projects. Use when working with crypto exchanges in C# applications, trading systems, or financial software. Supports .NET Standard 2.0+.

13

ccxt-php

ccxt

CCXT cryptocurrency exchange library for PHP developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in PHP 8.1+. Use when working with crypto exchanges in PHP projects, trading bots, or web applications. Supports both sync and async (ReactPHP) usage.

18

ccxt-python

ccxt

CCXT cryptocurrency exchange library for Python developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in Python. Use when working with crypto exchanges in Python projects, trading bots, data analysis, or portfolio management. Supports both sync and async (asyncio) usage.

16

ccxt-typescript

ccxt

CCXT cryptocurrency exchange library for TypeScript and JavaScript developers (Node.js and browser). Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors. Use when working with crypto exchanges in TypeScript/JavaScript projects, trading bots, arbitrage systems, or portfolio management tools. Includes both REST and WebSocket examples.

15

Search skills

Search the agent skills registry