跳到主要内容

Machine-Readable Specs

BTSE publishes its full API surface as standard OpenAPI 3.0.3 (for REST endpoints) and AsyncAPI 2.6.0 (for WebSocket channels) files. These are the same files this documentation site is generated from — they are the single source of truth.

Use them to generate clients, validate requests, drive Postman / Insomnia collections, or feed an AI coding assistant the complete API surface in a few hundred KB.

Building an AI agent or SDK?

Point your tool at the URLs below instead of HTML-scraping the documentation. The HTML pages render the same information, but the YAML files give you typed schemas, examples, error responses, and authentication requirements in a form a parser can rely on.


REST API specs (OpenAPI 3.0.3)

ProductBase URLDownload
Marketshttps://api.btse.commarkets-rest.openapi.yaml
Spothttps://api.btse.com/spotspot-rest.openapi.yaml
Futureshttps://api.btse.com/futuresfutures-rest.openapi.yaml
Wallethttps://api.btse.comwallet-rest.openapi.yaml
Earnhttps://api.btse.com/spotearn-rest.openapi.yaml
OTChttps://api.btse.comotc-rest.openapi.yaml

WebSocket API specs (AsyncAPI 2.6.0)

ProductEndpointDownload
Spotwss://ws.btse.com/ws/spotspot-websocket.asyncapi.yaml
Futureswss://ws.btse.com/ws/futuresfutures-websocket.asyncapi.yaml
OTCwss://ws.btse.com/ws/otcotc-websocket.asyncapi.yaml

What's in each spec

Every REST spec contains:

  • servers: — production and testnet base URLs
  • paths: — every endpoint with its method, parameters, request body schema, and response schema
  • components.securitySchemes: — declares the three required headers (request-api, request-nonce, request-sign) for private endpoints
  • components.schemas: — typed object schemas for orders, positions, wallet entries, etc.
  • Per-operation description, summary, and at least one example response

The path that appears in each spec is the signed urlpath — the exact string you concatenate with the nonce and body to compute request-sign. See Signed Request Walkthrough for the algorithm.


Common consumption patterns

Generate a client SDK

The site already ships pre-built Python, JavaScript, and Java SDKs. For other languages or custom generators:

# Install the OpenAPI generator (Java required)
npm install -g @openapitools/openapi-generator-cli

# Generate a Go client for the Spot REST API
openapi-generator-cli generate \
-i https://docs.btse.com/specs/spot-rest.openapi.yaml \
-g go \
-o ./btse-spot-go

Supported generators: see OpenAPI Generator's full list.

Validate requests in code

Use a runtime validator (e.g. openapi-core for Python, express-openapi-validator for Node, kin-openapi for Go) to reject malformed requests before they hit the network — useful in CI and in trading bots where catching a bad order shape locally is cheaper than a 400.

Drive a Postman / Insomnia collection

Both tools import OpenAPI directly:

  • Postman: File → Import → paste one of the URLs above
  • Insomnia: Application → Import/Export → Import Data → From URL

Each tool will scaffold every endpoint with parameter forms; you fill in your API key, nonce, and signature manually (or wire up a pre-request script using the Authentication signer code).

Feed an AI coding assistant

The full English documentation is also published as a single large text file at /llms-full.txt (~185 KB) — designed to be pasted into a model context for end-to-end coverage. The Chinese version is at /zh/llms-full.txt. A shorter index for discovery is at /llms.txt.

For programmatic consumption, prefer the structured YAML specs above over the markdown bundle — they parse losslessly and include type information.


Reporting spec issues

If you find a discrepancy between a spec file and actual API behavior, please report it to support.btse.com with the endpoint path and the diverging field. Specs are versioned alongside the docs site — fixes ship with the next deploy.