APIs Overview
Swarm exposes three distinct API surfaces, each serving a different integration need. This page explains what each area covers and helps you determine where to start.
The three API areas
Trading — dOTC v2
The dOTC (decentralised Over-The-Counter) API enables programmatic access to Swarm's on-chain RFQ and OTC trading protocol. Use it to create, take, and cancel offers directly at the smart contract level.
Best for: applications that need direct, low-level control over on-chain OTC trades — market making systems, trading bots, and protocol integrations.
Key capabilities:
- Request for Quote (RFQ) — get real-time quotes for token pairs
- Make Offer — deposit tokens and create a priced offer on-chain
- Take Offer — fill an existing offer (fully or partially)
- Cancel Offer — withdraw an open offer and reclaim deposited tokens
Onboarding
The Onboarding API manages KYC and KYB verification for users and businesses who need to trade regulated assets on Swarm. It integrates with Swarm's identity infrastructure to issue the on-chain NFT passport required for compliant trading.
Best for: platforms that onboard their own users into the Swarm ecosystem, or applications that need to gate features behind verified identity.
Key capabilities:
- Initiate a KYC or KYB verification session for a user
- Collect Source of Funds (SoF) documentation
- Poll verification status
- Handle resubmission of documents
→ Onboarding API documentation
Python SDK
The swarm-collection Python SDK provides a higher-level interface for trading RWAs, wrapping both the dOTC protocol and Swarm's centralised stock market access behind a unified, async-native client. It handles Web3 interactions, authentication, token approvals, and smart routing automatically.
Best for: Python applications that want to trade without managing smart contract interactions directly. Particularly suited to trading UIs, portfolio managers, and algorithmic strategies.
Key capabilities:
- Smart routing with automatic best-price selection across platforms
- Market Maker SDK for 24/7 decentralised P2P OTC trading
- Cross-Chain Access SDK for regulated stock market trading at real exchange prices
- Cross-chain delivery — send from one network, receive on any other
Choosing the right API
| dOTC v2 | Onboarding API | Python SDK | |
|---|---|---|---|
| Language / interface | REST / on-chain | REST | Python |
| Abstraction level | Low — direct contract interaction | Service API | High — managed client |
| Use case | Protocol integrations, bots | User onboarding | Trading applications |
| KYC required | Depends on asset | This is the KYC API | Depends on platform |
| 24/7 availability | ✅ | ✅ | ✅ (Market Maker) / ❌ (Cross-Chain Access) |
Authentication
Each API area uses different authentication mechanisms:
dOTC v2 uses wallet-based authentication via EIP-191 message signing. No API key is required for public endpoints; permissioned endpoints require a signed JWT.
Onboarding API uses Bearer JWT authentication plus a source_key query parameter issued to integration partners. Both are required on every request.
Python SDK handles authentication automatically — it signs messages with your wallet's private key when you initialise the client. An RPQ API Key is also required for Market Maker access.
See each section's documentation for full authentication details.
.png)