# PulseSwap API

PulseSwap is a multi-chain DEX aggregator that finds the best swap prices across multiple liquidity sources. It scans 12+ aggregators and 50+ DEXs in real time, including PulseX, 9inch, and others. Developers can integrate PulseSwap to give users cost-efficient swaps directly inside their applications.

**Supported DEXs / Aggreagators:**

* PulseX (v1)
* PulseX (v2)
* Piteas
* 9inch (v2)
* 9inch (v3)
* 9mm (v2)
* 9mm (v3)

### Base URL

```
https://quotes.pulseswap.io/api/v1
```

### Endpoint: Get Best Quote

Returns the best available quote for a given token pair and amount, scanning all supported DEXes.

**Method:**\
`POST /quotes/best`

#### Request Body

<table><thead><tr><th width="135.0625">Field</th><th width="87.6796875">Type</th><th width="117.12109375">Required</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>walletAddress</td><td>string</td><td>No</td><td>Ethereum-compatible wallet address</td><td><code>0x1234567890123456789012345678901234567890</code></td></tr><tr><td>fromToken</td><td>string</td><td>Yes</td><td>Contract address of token to swap from</td><td><code>0xA1077a294dDE1B09bB078844df40758a5D0f9a27</code></td></tr><tr><td>toToken</td><td>string</td><td>Yes</td><td>Contract address of token to receive</td><td><code>0x2b591e99afe9f32eaa6214f7b7629768c40eeb39</code></td></tr><tr><td>amountIn</td><td>string</td><td>Yes</td><td>Amount in smallest unit (string for large ints)</td><td><code>1000000000000000000</code></td></tr><tr><td>slippage</td><td>number</td><td>Yes</td><td>Slippage tolerance in % (e.g., <code>0.5</code>)</td><td><code>0.5</code></td></tr></tbody></table>

#### Example Request JSON

```json
{
  "walletAddress": "0x1234567890123456789012345678901234567890",
  "fromToken": "0xA1077a294dDE1B09bB078844df40758a5D0f9a27",
  "toToken": "0x2b591e99afe9f32eaa6214f7b7629768c40eeb39",
  "amountIn": "1000000000000000000",
  "slippage": 0.5
}
```

***

#### Response

<table><thead><tr><th width="159.1015625">Field</th><th width="118.89453125">Type</th><th width="201.91015625">Description</th><th>Example</th></tr></thead><tbody><tr><td>success</td><td>boolean</td><td>Request success status</td><td><code>true</code></td></tr><tr><td>tokenPath</td><td>string[]</td><td>Swap route as array of token addresses</td><td><code>["0xA1077...", "0x2b59..."]</code></td></tr><tr><td>amountOut</td><td>string</td><td>Expected output amount (smallest unit)</td><td><code>1000000000</code></td></tr><tr><td>gasUseEstimate</td><td>number</td><td>Estimated gas usage</td><td><code>100000</code></td></tr><tr><td>tx</td><td>object</td><td>Transaction details (optional)</td><td>See below</td></tr></tbody></table>

**Transaction Object:**

<table><thead><tr><th>Field</th><th width="222.17578125">Type</th><th>Description</th></tr></thead><tbody><tr><td>from</td><td>string</td><td>Sender address</td></tr><tr><td>to</td><td>string</td><td>Contract address to call</td></tr><tr><td>value</td><td>string</td><td>ETH value in wei (optional)</td></tr><tr><td>data</td><td>string</td><td>Encoded transaction data (optional)</td></tr></tbody></table>

#### Example Response JSON

```json
{
  "success": true,
  "tokenPath": [
    "0xA1077a294dDE1B09bB078844df40758a5D0f9a27",
    "0x2b591e99afe9f32eaa6214f7b7629768c40eeb39"
  ],
  "amountOut": "1000000000000",
  "gasUseEstimate": 100000,
  "tx": {
    "from": "0x1234567890123456789012345678901234567890",
    "to": "0x641115e36eDEa30Fee041156b15585C99A8BF398",
    "value": "10000000000000000000000000",
    "data": "0x..."
  }
}
```

***

### Example cURL

```bash
curl -X POST "https://quotes.pulseswap.io/api/v1/quotes/best" \
  -H "Content-Type: application/json" \
  -d '{
    "walletAddress": "0x1234567890123456789012345678901234567890",
    "fromToken": "0xA1077a294dDE1B09bB078844df40758a5D0f9a27",
    "toToken": "0x2b591e99afe9f32eaa6214f7b7629768c40eeb39",
    "amountIn": "1000000000000000000",
    "slippage": 0.5
  }'
```

***

### Error Responses

**400 Bad Request**

```json
{
  "statusCode": 400,
  "message": [
    "walletAddress must be an Ethereum address",
    "fromToken must be an Ethereum address",
    "toToken must be an Ethereum address",
    "amountIn should not be empty",
    "slippage should not be empty"
  ],
  "error": "Bad Request"
}
```

**500 Internal Server Error**

```json
{
  "statusCode": 500,
  "message": "Internal server error"
}
```

***

### Developer Notes

* All token addresses must be valid Ethereum-compatible addresses.
* Always pass `amountIn` as a string to avoid integer overflow.
* `slippage` is expressed as a percentage (`0.5` = 0.5%).
* Gas estimates are approximate and may vary at execution.
* The API automatically searches all supported DEXes for the best possible rate.
* Contact/support via X [@PulseCoinList](https://x.com/PulseCoinList)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pulse.domains/partner/pulseswap.io-the-aggregator-of-aggregators/pulseswap-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
