Choose the hosted API when you want the service to select routes and return its documented execution artifacts. Choose SDK routing when your application needs direct control over pool discovery, route search inputs and transaction construction.
PancakeSwap's Unified Swap API offers a hosted interface with engine-specific candidates. The SDK catalogue provides separate packages for routing, pool math, token primitives and transaction building.
Compare engineering responsibilities
| Question | Hosted route | Local SDK route |
|---|---|---|
| Who collects routing inputs? | Service behind the API | Your configured providers |
| Who bounds route search work? | Service plus client request budget | Your application |
| Who handles wallet and receipts? | Your application | Your application |
Local routing still depends on fresh chain data and compatible deployments. Installing a package does not create a complete index of useful liquidity. Hosted routing still requires response validation, permissions and transaction tracking; outsourcing the search does not outsource those boundaries.
Start from the required execution mode
If the product wants a signed PancakeSwap X order, confirm that the chosen SDK or API path supports that lifecycle. A conventional router trade object cannot stand in for a signable intent.
Build a small proof of integration using representative assets and failure fixtures before committing to either architecture. Measure latency and resource use in your environment, and document unsupported cases. This page does not rank cost or claim one route always finds a better price.
A hybrid can use a hosted primary and a local fallback, but both must produce the same reviewed trade semantics. Never treat fallback as permission to remove slippage, recipient or source restrictions.
Sources & verification (2)
Source-check date is recorded in the article details. URLs are provided for manual verification. Use Copy to keep this page open.
- Unified Swap API
Engine branches and flow overview
https://developer.pancakeswap.finance/contracts/unified-swap-api/overview - SDKs
PancakeSwap package roles
https://developer.pancakeswap.finance/sdks/overview