*** title: Get Started with Permit2 (Advanced) description: >- Advanced guide covering how to get started using 0x Swap API (Permit2) to securely swap ERC-20 tokens. ---------------------------- ⚠️ The **Permit2** flow is intended for **advanced integrators only**. If you're new to 0x Swap API or want to avoid the double-signature UX, consider using [AllowanceHolder](/docs/swap-api/guides/build-token-swap-d-app-next-js) instead. ## About Swap API Swap API is a DEX aggregation and smart order routing REST API that finds the best price for crypto trades. With one API integration, you can easily add trading to your app. Swap API aggregates liquidity from 150+ sources , including AMMs and professional market makers, across the [supported chains](/docs/introduction/supported-chains). ![Swap API UI](https://files.buildwithfern.com/0x.docs.buildwithfern.com/fcd0acfc26bda98f67d639e66e85a7d59c2418fbb42bb247dad6f4d917509618/docs/assets/img/0x-swap-api/swap-api-ui.png) The API handles three key tasks: * Queries ERC20 prices from decentralized exchanges and market makers * Aggregates liquidity for the best possible price * Returns a trade format executable via your preferred web3 library ## What You Will Learn This guide will cover the core steps to using Swap API, specifically using the [Swap Permit2](/api-reference#tag/Swap/operation/swap::permit2::getPrice) endpoint. Learn about the [difference between Permit2 and AllowanceHolder in Swap API](/docs/introduction/faq#allowanceholder-and-permit2) ## Try It Out ### Example Code Follow along locally with the code example: [https://github.com/0xProject/0x-examples/tree/main/swap-v2-permit2-headless-example](https://github.com/0xProject/0x-examples/tree/main/swap-v2-permit2-headless-example) ### Playground Try this code example directly in your browser—no installation needed!