For the complete documentation index, see llms.txt. This page is also available as Markdown.

BSC Aggregator HTTP API

Get a quote and transaction in one Allowance request or two Permit2 requests.

Use https://api.peach.ag on BSC Mainnet (chain ID 56). The HTTP API queries prices and builds transaction data; your wallet or executor submits the transaction.

Method
Endpoint
Purpose

GET

/router/status

Get Status: providers, sync state and current router configuration

GET

/router/swap/allowance

Swap Allowance: Direct Allowance, with payer = executor

GET

/router/swap/permit2

Swap Permit2: freeze a plan and return payer signing data

POST

/router/swap/permit2/build

Swap Permit2 Build: attach the payer signature to the prepared plan

New endpoint deployment has not been verified for the production URL.

  • Allowance: one GET /router/swap/allowance request returns the quote, selected paths and executable transaction. Review the terms, approve if needed and submit that same transaction.

  • Permit2: GET /router/swap/permit2 returns the quote, frozen plan and payer signing material. After payer signing, POST /router/swap/permit2/build returns the executable transaction. Build does not search routes again.

These counts include Aggregator requests only; approvals, signing, simulation and submission are separate. The matching SDK methods are swapAllowance(), swapPermit2() and swapPermit2Build().

Request and response conventions

Token inputs use from and target; HTTP amounts use amount. Send amounts as unsigned decimal integers in token base units, such as 1000000000000000 for 0.001 BNB. Response amounts are decimal strings. Use integer arithmetic when converting or comparing them.

Successful responses contain code: 200, msg and data. Check both the HTTP status and the JSON code: business errors can arrive with HTTP status 200 and omit data. See Error Codes.

Use by_amount_in=true for exact-input swaps. See Swap Allowance for a runnable request and its response schema.

Confirm and execute

Review roles, amounts, fees and deadline before submitting the returned tx.to, tx.data and tx.value unchanged from the executor address. ERC20 approval targets differ: the Execution Router (tx.to) for Allowance, canonical Permit2 for delegated funding.

See Swap Allowance for Allowance roles and paths, or Swap Permit2 and Swap Permit2 Build for the payer-signing flow.

Supply slippage_bps and deadline_secs explicitly when the application has fixed requirements. Slippage applies to net output after custom fees:

amount_out_min = floor(expect_amount_out × (10000 − slippage_bps) / 10000)

amount_out is gross output, and expect_amount_out is expected net output before slippage. Custom fees require custom_fee_receiver and must stay within the current fee cap returned by /router/status.

Native BNB

Use WBNB (0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c) in the HTTP token fields. For native input, set native_in=true and attach the returned tx.value in wei. For native output, set native_out=true with WBNB as target. Enable only one native direction. Delegated swaps support native output and require ERC20 input.

The SDK native-token sentinel is handled by the SDK; do not send it as an HTTP token address.

Service configuration

Read /router/status for current provider availability, execution-router address and any advertised builder defaults. On October 10, 2026, the BSC response reported default_slippage_bps: 50, default_deadline_secs: 120, delegated_max_deadline_secs: 300 and build_max_attempts_per_quote: 8. These settings can change; they are service snapshots and do not replace on-chain validation.

Existing integrations

The old /router/swap, /router/swap/prepare and /router/swap/build addresses remain compatible aliases for the three swap endpoints above. /router/quote also remains a legacy compatibility endpoint.

find_routes remains available and is planned for future deprecation; no removal date is announced. The swap endpoints include quoting and do not require it first. Keep the Find Routes (Legacy) reference for existing callers, and use the Migration Guide for method and field mappings.

Last updated

Was this helpful?