> ## Documentation Index
> Fetch the complete documentation index at: https://docs.solanatracker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a Solana swap quote with Raptor

> Find the best route for a Solana swap and get the expected output. No wallet needed. Pass the response to POST /swap within a few seconds. GET /quote.

Find the best route for a swap and return the expected output. No wallet is needed.

Pass the whole response to `POST /swap` unchanged, and do it within a few seconds: quotes that carry a `quoteId` point to a short-lived execution plan.


## OpenAPI

````yaml /raptor/http/openapi.json get /quote
openapi: 3.0.3
info:
  title: Raptor Swap API
  description: >-
    Solana swap quotes, ready-to-sign swap transactions, transaction sending and
    status tracking. No API key is required.
  version: 1.0.0
  contact:
    name: Solana Tracker Discord
    url: https://discord.gg/JH2e9rR9fc
servers:
  - url: https://raptor.solanatracker.io
    description: Hosted Raptor
security: []
paths:
  /quote:
    get:
      summary: Get swap quote
      description: >-
        Find the best route for a swap and return the expected output. No wallet
        is needed.


        Pass the whole response to `POST /swap` unchanged, and do it within a
        few seconds: quotes that carry a `quoteId` point to a short-lived
        execution plan.
      operationId: getQuote
      parameters:
        - name: inputMint
          in: query
          required: true
          description: >-
            Mint address of the token you sell. Use
            `So11111111111111111111111111111111111111112` for SOL.
          schema:
            type: string
          example: So11111111111111111111111111111111111111112
        - name: outputMint
          in: query
          required: true
          description: Mint address of the token you buy.
          schema:
            type: string
          example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
        - name: amount
          in: query
          required: true
          description: >-
            Amount to sell, in the input token's smallest unit (for SOL,
            lamports: `1000000000` = 1 SOL).
          schema:
            type: integer
            minimum: 1
          example: 100000000
        - name: slippageBps
          in: query
          required: false
          description: >-
            Maximum slippage in basis points (`50` = 0.5%), or `dynamic` to let
            Raptor choose based on volatility and route.
          schema:
            type: string
            default: '50'
          example: '50'
        - name: dexes
          in: query
          required: false
          description: >-
            Only route through these DEXes. Comma-separated, case-insensitive. A
            family name such as `raydium` matches all its pool types; use
            `raydium-clmm`, `meteora-dlmm` and so on for one type.
          schema:
            type: string
          example: raydium,meteora,whirlpool
        - name: pools
          in: query
          required: false
          description: Only route through these pool addresses. Comma-separated.
          schema:
            type: string
        - name: maxHops
          in: query
          required: false
          description: Maximum number of hops in the route.
          schema:
            type: integer
            minimum: 1
            maximum: 4
            default: 4
        - name: onlyDirectRoutes
          in: query
          required: false
          description: Only use single-hop routes. Same as `maxHops=1`.
          schema:
            type: boolean
            default: false
        - name: jitRouting
          in: query
          required: false
          description: >-
            Just-in-time routing. `auto` uses it when it improves execution,
            `true` always uses it, `false` turns it off. See [JIT
            routing](/raptor/overview#jit-routing).
          schema:
            type: string
            enum:
              - auto
              - 'true'
              - 'false'
            default: auto
        - name: searchMode
          in: query
          required: false
          description: '`deep` searches more routes and takes longer.'
          schema:
            type: string
            enum:
              - fast
              - deep
            default: fast
        - name: feeAccount
          in: query
          required: false
          description: >-
            Wallet that receives your platform fee. Required when `feeBps` is
            set.
          schema:
            type: string
        - name: feeBps
          in: query
          required: false
          description: Platform fee in basis points (max `1000` = 10%).
          schema:
            type: integer
            minimum: 0
            maximum: 1000
            default: 0
        - name: feeFromInput
          in: query
          required: false
          description: >-
            Take the platform fee from the input token instead of the output
            token.
          schema:
            type: boolean
            default: false
        - name: chargeBps
          in: query
          required: false
          description: >-
            Extra fee, in basis points, taken only from positive slippage
            (output above the quote).
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: wrapUnwrapSol
          in: query
          required: false
          description: Quote for native SOL. Use the same value you will send to `/swap`.
          schema:
            type: boolean
            default: true
        - name: userPublicKey
          in: query
          required: false
          description: >-
            Wallet that will run the swap. Optional; quotes do not check
            balances.
          schema:
            type: string
      responses:
        '200':
          description: Quote
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteResponse'
              example:
                inputMint: So11111111111111111111111111111111111111112
                outputMint: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                amountIn: '100000000'
                amountOut: '11703794'
                minAmountOut: '11645275'
                priceImpact: 0
                slippageBps: 50
                routePlan:
                  - programId: 9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp
                    dex: Humidifi
                    pool: 8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu
                    inputMint: So11111111111111111111111111111111111111112
                    outputMint: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                    amountIn: '100000000'
                    amountOut: '11703794'
                    priceImpact: 0
                    percent: 100
                swapUsdValue: '11.72'
                platformFee:
                  feeBps: 0
                  feeFromInput: false
                  chargeBps: 0
                contextSlot: 454215309
                timeTaken: 0.026
                quoteId: AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU
                searchMode: fast
        '400':
          $ref: '#/components/responses/BadRequest'
        '422':
          $ref: '#/components/responses/NoRoute'
        '500':
          description: The quote failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: 'Failed to get quote: No multi-hop route found'
                code: 500
        '503':
          description: Service is starting up
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    QuoteResponse:
      type: object
      description: >-
        Quote returned by `GET /quote`. Send it back unchanged as
        `quoteResponse`.
      required:
        - inputMint
        - outputMint
        - amountIn
        - amountOut
        - minAmountOut
        - priceImpact
        - slippageBps
        - routePlan
        - contextSlot
        - timeTaken
      properties:
        inputMint:
          type: string
          description: Mint of the token sold
        outputMint:
          type: string
          description: Mint of the token bought
        amountIn:
          type: string
          description: Amount sold, in the input token's smallest unit
        amountOut:
          type: string
          description: Expected amount received, in the output token's smallest unit
        minAmountOut:
          type: string
          description: >-
            Least amount the swap will accept after slippage. The transaction
            fails rather than fill below this.
        feeAmount:
          type: string
          description: Pool fees for the route, when reported
        priceImpact:
          type: number
          description: Price impact in percent (`0.25` = 0.25%)
        slippageBps:
          type: integer
          description: Slippage used, in basis points
        routePlan:
          type: array
          description: Steps of the route, in order
          items:
            $ref: '#/components/schemas/RouteStep'
        swapUsdValue:
          type: string
          description: USD value of the input amount
        platformFee:
          $ref: '#/components/schemas/PlatformFee'
        tokenTransfers:
          $ref: '#/components/schemas/TokenTransfers'
        contextSlot:
          type: integer
          description: Slot the quote was computed at
        timeTaken:
          type: number
          description: Time to compute the quote, in seconds
        jitRouting:
          type: boolean
          description: '`true` when the quote uses a just-in-time route'
        quoteId:
          type: string
          description: Reference to the stored execution plan. Expires after a few seconds.
        searchMode:
          type: string
          enum:
            - fast
            - deep
          description: Search mode used
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: What went wrong
        code:
          type: integer
          description: HTTP status code
    RouteStep:
      type: object
      required:
        - programId
        - dex
        - pool
        - inputMint
        - outputMint
        - amountIn
        - amountOut
        - priceImpact
      properties:
        programId:
          type: string
          description: DEX program ID
        dex:
          type: string
          description: DEX name
        pool:
          type: string
          description: Pool address
        inputMint:
          type: string
          description: Mint going into this step
        outputMint:
          type: string
          description: Mint coming out of this step
        amountIn:
          type: string
          description: Amount into this step
        amountOut:
          type: string
          description: Amount out of this step
        feeAmount:
          type: string
          description: Pool fee for this step, when reported
        priceImpact:
          type: number
          description: Price impact of this step, in percent
        percent:
          type: integer
          description: Share of the input sent through this step
    PlatformFee:
      type: object
      description: Your platform fee settings, as applied to the quote
      properties:
        feeAccount:
          type: string
          description: Wallet that receives the fee
        feeBps:
          type: integer
          description: Fee in basis points
        feeFromInput:
          type: boolean
          description: '`true` if the fee is taken from the input token'
        chargeBps:
          type: integer
          description: Fee on positive slippage, in basis points
    TokenTransfers:
      type: object
      description: >-
        Present only when the input or output token charges a Token-2022
        transfer fee. Amounts are strings in the token's smallest unit.
      properties:
        depositFee:
          type: string
          description: Transfer fee charged on the input token
        deliveryFee:
          type: string
          description: Transfer fee charged on the output token
        netOutput:
          type: string
          description: What reaches the wallet after platform and transfer fees
  responses:
    BadRequest:
      description: A parameter is missing or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: 'Invalid amount: must be greater than 0'
            code: 400
        text/plain:
          schema:
            type: string
          example: 'Failed to deserialize query string: missing field `amount`'
    NoRoute:
      description: >-
        No route for this pair and amount. Try another amount or fewer routing
        filters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: 'Failed to get quote: No multi-hop route found'
            code: 422

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.