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

# GetSwapPrices



## OpenAPI

````yaml sequence-api.json post /rpc/API/GetSwapPrices
openapi: 3.0.0
info:
  title: Sequence Api
  version: 0.0.1
servers:
  - url: https://api.sequence.app/
    description: Api
security: []
paths:
  /rpc/API/GetSwapPrices:
    post:
      summary: GetSwapPrices
      description: >-
        Retrieve swap prices for the specified ERC20 token at the address
        provided as 'buyCurrencyAddress'. The result will be 'null' if the user
        lacks sufficient funds or if there is insufficient pool liquidity.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/API_GetSwapPrices_Request'
            example:
              userAddress: '0x1fEA9Fcbd1989C0f2D0Fbad08144c528c7F5ea54'
              buyCurrencyAddress: '0x50ba9d89fbfa2862d0447281219a3058e7724224'
              buyAmount: '1000000000000000000'
              chainId: 11155111
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_GetSwapPrices_Response'
        4XX:
          description: Client error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorWebrpcEndpoint'
                  - $ref: '#/components/schemas/ErrorWebrpcRequestFailed'
                  - $ref: '#/components/schemas/ErrorWebrpcBadRoute'
                  - $ref: '#/components/schemas/ErrorWebrpcBadMethod'
                  - $ref: '#/components/schemas/ErrorWebrpcBadRequest'
                  - $ref: '#/components/schemas/ErrorWebrpcClientDisconnected'
                  - $ref: '#/components/schemas/ErrorWebrpcStreamLost'
                  - $ref: '#/components/schemas/ErrorUnauthorized'
                  - $ref: '#/components/schemas/ErrorPermissionDenied'
                  - $ref: '#/components/schemas/ErrorSessionExpired'
                  - $ref: '#/components/schemas/ErrorAborted'
                  - $ref: '#/components/schemas/ErrorGeoblocked'
                  - $ref: '#/components/schemas/ErrorInvalidArgument'
                  - $ref: '#/components/schemas/ErrorUnavailable'
                  - $ref: '#/components/schemas/ErrorQueryFailed'
                  - $ref: '#/components/schemas/ErrorNotFound'
        5XX:
          description: Server error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorWebrpcBadResponse'
                  - $ref: '#/components/schemas/ErrorWebrpcServerPanic'
                  - $ref: '#/components/schemas/ErrorWebrpcInternalError'
      security:
        - ApiKeyAuth:
            - AQAAAAAAAEGvyZiWA9FMslYeG_yayXaHnSI
components:
  schemas:
    API_GetSwapPrices_Request:
      type: object
      properties:
        userAddress:
          type: string
        buyCurrencyAddress:
          type: string
        buyAmount:
          type: string
        chainId:
          type: number
        slippagePercentage:
          type: number
    API_GetSwapPrices_Response:
      type: object
      properties:
        swapPrices:
          type: array
          description: '[]SwapPrice'
          items:
            $ref: '#/components/schemas/SwapPrice'
    ErrorWebrpcEndpoint:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcEndpoint
        code:
          type: number
          example: 0
        msg:
          type: string
          example: endpoint error
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcRequestFailed:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcRequestFailed
        code:
          type: number
          example: -1
        msg:
          type: string
          example: request failed
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcBadRoute:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadRoute
        code:
          type: number
          example: -2
        msg:
          type: string
          example: bad route
        cause:
          type: string
        status:
          type: number
          example: 404
    ErrorWebrpcBadMethod:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadMethod
        code:
          type: number
          example: -3
        msg:
          type: string
          example: bad method
        cause:
          type: string
        status:
          type: number
          example: 405
    ErrorWebrpcBadRequest:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadRequest
        code:
          type: number
          example: -4
        msg:
          type: string
          example: bad request
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcClientDisconnected:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcClientDisconnected
        code:
          type: number
          example: -8
        msg:
          type: string
          example: client disconnected
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcStreamLost:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcStreamLost
        code:
          type: number
          example: -9
        msg:
          type: string
          example: stream lost
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorUnauthorized:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Unauthorized
        code:
          type: number
          example: 1000
        msg:
          type: string
          example: Unauthorized access
        cause:
          type: string
        status:
          type: number
          example: 401
    ErrorPermissionDenied:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: PermissionDenied
        code:
          type: number
          example: 1001
        msg:
          type: string
          example: Permission denied
        cause:
          type: string
        status:
          type: number
          example: 403
    ErrorSessionExpired:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: SessionExpired
        code:
          type: number
          example: 1002
        msg:
          type: string
          example: Session expired
        cause:
          type: string
        status:
          type: number
          example: 403
    ErrorAborted:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Aborted
        code:
          type: number
          example: 1005
        msg:
          type: string
          example: Request aborted
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorGeoblocked:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Geoblocked
        code:
          type: number
          example: 1006
        msg:
          type: string
          example: Geoblocked region
        cause:
          type: string
        status:
          type: number
          example: 451
    ErrorInvalidArgument:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: InvalidArgument
        code:
          type: number
          example: 2000
        msg:
          type: string
          example: Invalid argument
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorUnavailable:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Unavailable
        code:
          type: number
          example: 2002
        msg:
          type: string
          example: Unavailable resource
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorQueryFailed:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: QueryFailed
        code:
          type: number
          example: 2003
        msg:
          type: string
          example: Query failed
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorNotFound:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: NotFound
        code:
          type: number
          example: 3000
        msg:
          type: string
          example: Resource not found
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcBadResponse:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadResponse
        code:
          type: number
          example: -5
        msg:
          type: string
          example: bad response
        cause:
          type: string
        status:
          type: number
          example: 500
    ErrorWebrpcServerPanic:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcServerPanic
        code:
          type: number
          example: -6
        msg:
          type: string
          example: server panic
        cause:
          type: string
        status:
          type: number
          example: 500
    ErrorWebrpcInternalError:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcInternalError
        code:
          type: number
          example: -7
        msg:
          type: string
          example: internal error
        cause:
          type: string
        status:
          type: number
          example: 500
    SwapPrice:
      type: object
      required:
        - currencyAddress
        - currencyBalance
        - price
        - maxPrice
        - transactionValue
      properties:
        currencyAddress:
          type: string
        currencyBalance:
          type: string
        price:
          type: string
        maxPrice:
          type: string
        transactionValue:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      description: >-
        Public project access key for authenticating requests obtained on
        Sequence Builder. Example Test Key: AQAAAAAAAEGvyZiWA9FMslYeG_yayXaHnSI
      name: X-Access-Key

````