> For the complete documentation index, see [llms.txt](https://docs.peach.ag/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.peach.ag/api-reference/readme/find-routes.md).

# Find Routes (Legacy)

Legacy quote-only endpoint. Available for compatibility; planned for future deprecation.

## Find Routes (Legacy)

> Planned future deprecation: this legacy quote endpoint remains available for compatibility; no removal date is announced. New integrations should use GET /router/swap/allowance, or GET /router/swap/permit2 then POST /router/swap/permit2/build. Migration guide: <https://docs.peach.ag/documentation/bsc/aggregator/editor/migration-guide>. Price-only exact-input route lookup. Does not approve tokens, build calldata or broadcast a transaction. For native BNB, route using WBNB. Send by\_amount\_in=true for the documented v7 flow. The same route also accepts POST JSON in the backend; this reference documents the GET workflow used by the SDK.

```json
{"openapi":"3.0.3","info":{"title":"BSC Aggregator HTTP API","version":"2026-10-20"},"tags":[{"name":"BSC Aggregator HTTP API","description":"Allowance: one request for a quote and executable transaction. Permit2: prepare, payer signing, then build. No prior find_routes request is required."}],"servers":[{"url":"https://api.peach.ag","description":"BSC production API (chain ID 56); operation availability follows deployment."}],"paths":{"/router/find_routes":{"get":{"operationId":"findRoutes","tags":["BSC Aggregator HTTP API"],"summary":"Find Routes (Legacy)","description":"Planned future deprecation: this legacy quote endpoint remains available for compatibility; no removal date is announced. New integrations should use GET /router/swap/allowance, or GET /router/swap/permit2 then POST /router/swap/permit2/build. Migration guide: https://docs.peach.ag/documentation/bsc/aggregator/editor/migration-guide. Price-only exact-input route lookup. Does not approve tokens, build calldata or broadcast a transaction. For native BNB, route using WBNB. Send by_amount_in=true for the documented v7 flow. The same route also accepts POST JSON in the backend; this reference documents the GET workflow used by the SDK.","parameters":[{"name":"from","in":"query","required":true,"description":"Input ERC20 token address. Use WBNB for native BNB routing.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}},{"name":"target","in":"query","required":true,"description":"Output ERC20 token address; must differ from from. Use WBNB for native BNB routing.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}},{"name":"amount","in":"query","required":true,"description":"Positive unsigned integer, at most 2^128 - 1, in input-token base units for the documented exact-input flow. Send decimal digits, never a human-readable fractional amount.","schema":{"type":"string","pattern":"^[0-9]+$"}},{"name":"by_amount_in","in":"query","required":false,"description":"Use true for the documented exact-input v7 workflow. Omission defaults to true. A legacy false flag can be parsed by the server but does not establish supported exact-output behavior.","schema":{"type":"boolean","enum":[true],"default":true}},{"name":"depth","in":"query","required":false,"description":"Maximum route hops. Omission or 0 uses the service routing configuration; values above its maximum are rejected.","schema":{"type":"integer","minimum":0}},{"name":"split_count","in":"query","required":false,"description":"Requested split count. Omission or 0 uses the configured maximum; the service can reduce it for trade size and metadata availability.","schema":{"type":"integer","minimum":0}},{"name":"providers","in":"query","required":false,"description":"Comma-separated provider identifiers from Get Status. Omit to use the enabled provider set; availability and version filters still apply.","schema":{"type":"string"}},{"name":"v","in":"query","required":true,"description":"Client version. Required and must be at least 1001500 for find_routes; this is not the SDK package version.","schema":{"type":"integer","minimum":1001500}},{"name":"gas","in":"query","required":false,"description":"Optional gas limit override. Prefer the service estimate unless you have measured the complete execution path.","schema":{"type":"integer","minimum":0}},{"name":"cal_path_limit","in":"query","required":false,"description":"Optional advanced path-calculation limit; behavior follows the service routing configuration.","schema":{"type":"integer","minimum":0}},{"name":"apikey","in":"query","required":false,"description":"Optional integrator identifier used for service engine/provider selection. It appears in URL logs and is not a secret authentication token.","schema":{"type":"string"}}],"responses":{"200":{"description":"Application success (code=200) or application error (code!=200). Business errors may still have HTTP status 200; inspect the JSON code.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/FindRoutesResponse"},{"$ref":"#/components/schemas/Error"}]}}},"headers":{}},"400":{"description":"Malformed query or request rejected by HTTP extraction. Body may be plain text rather than an application envelope.","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Unhandled service failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service-wide rate limit / circuit breaking. Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"FindRoutesResponse":{"type":"object","properties":{"code":{"type":"integer","enum":[200]},"msg":{"type":"string"},"data":{"$ref":"#/components/schemas/FindRoutesData"}},"required":["code","msg","data"]},"FindRoutesData":{"type":"object","properties":{"request_id":{"type":"string"},"quote_ts":{"type":"integer","minimum":0,"description":"Quote creation time, Unix milliseconds."},"amount_in":{"type":"string","pattern":"^[0-9]+$","description":"Gross input amount the payer sends; routed input may be smaller for a transfer-tax token."},"amount_out":{"type":"string","pattern":"^[0-9]+$","description":"Gross route output before custom fees."},"deviation_ratio":{"type":"string"},"deviation_skip_reason":{"type":"string","description":"Present if the oracle deviation check was skipped."},"paths":{"type":"array","items":{"$ref":"#/components/schemas/RoutePath"}},"contracts":{"$ref":"#/components/schemas/Contracts"},"gas":{"type":"integer","minimum":0,"description":"Service gas estimate."}},"required":["request_id","quote_ts","amount_in","amount_out","deviation_ratio","paths","contracts"]},"RoutePath":{"type":"object","properties":{"pool":{"type":"string","description":"Provider-native pool address or bytes32 pool ID for singleton venues."},"provider":{"type":"string","description":"Open provider identifier, such as PANCAKEV3."},"adapter":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"20-byte EVM address, prefixed with 0x."},"token_in":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"20-byte EVM address, prefixed with 0x."},"token_out":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"20-byte EVM address, prefixed with 0x."},"direction":{"type":"boolean","description":"true for token0 to token1."},"fee_rate":{"type":"string","description":"Decimal fee rate; 0.0005 means 0.05%."},"amount_in":{"type":"string","pattern":"^[0-9]+$","description":"Step input amount in input-token base units."},"amount_out":{"type":"string","pattern":"^[0-9]+$","description":"Step output amount in output-token base units."},"extra_data":{"type":"string","pattern":"^0x(?:[0-9a-fA-F]{2})*$"}},"required":["pool","provider","adapter","token_in","token_out","direction","fee_rate","amount_in","amount_out"]},"Contracts":{"type":"object","properties":{"router":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Legacy PeachRouter proxy. Do not choose this as the transaction target for the new swap flow."},"execution_router":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"ExecutionPlan router; returned tx.to is the transaction target."}},"required":["router","execution_router"]},"Error":{"type":"object","properties":{"code":{"type":"integer","minimum":0,"maximum":65535,"not":{"enum":[200]},"description":"Application result code, distinct from HTTP status. See Error Codes."},"msg":{"type":"string","description":"Human-readable explanation."}},"required":["code","msg"],"description":"Application errors omit data. Business errors normally use HTTP 200; check code==200 before consuming data."}}}}
```

### Usage notes

This quote-only endpoint remains available for compatibility and is planned for future deprecation. No removal date is announced. Use the swap endpoints for new integrations; see the [Migration Guide](https://docs.peach.ag/documentation/bsc/aggregator/editor/migration-guide).

Check both the HTTP status and JSON `code`. See [Error Codes](https://docs.peach.ag/api-reference/readme/error-codes) for recovery guidance. Invalid query or body extraction may return plain text instead of the JSON envelope.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.peach.ag/api-reference/readme/find-routes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
