Skip to content
QSwapDocs

API reference

Every endpoint of the QSwap API, the small proxy between the app and Jupiter. Matches docs/API-CONTRACT.md.

Base URL

Where requests go
Browser$NEXT_PUBLIC_API_URL/swap/orderhttps://api.jup.agSOLANA_RPC_URL
  • No version prefix: /swap/order, not /v1/swap/order
  • The Jupiter key and the RPC URL stay on the server
Source: docs/API-CONTRACT.md

Conventions

Reading a payload
GET /swap/order?
  inputMint=So111…11121
  &outputMint=EPjF…Dt1v
  &amount=10000000002
  &slippageBps=503

← 404
{ "error": { code: "NO_ROUTE", message, details } }4
  1. 1Mints are base58. SOL is the wrapped-SOL mint.
  2. 2Amounts: smallest units, as a string
  3. 3bps: 50 = 0.5%. Leave it out for auto.
  4. 4Every error has this shape

Endpoints

Endpoints · v1
  • GET/health

    Liveness and version.

    Parameters
    No parameters
    Responses
    200
    Example
    {
      "ok": true,
      "version": "0.1.0"
    }
    curl "$QSWAP_API/health"
  • GET/config

    Cluster, public RPC URL, fees, slippage limits, feature flags, default pair. Cache 5 minutes.

    Parameters
    No parameters
    Responses
    200Config
    Example
    {
      "cluster": "mainnet-beta",
      "rpcUrl": "https://<api>/rpc",
      "explorerTxUrl": "https://solscan.io/tx/{signature}",
      "fees": {
        "referralBps": 0
      },
      "slippage": {
        "defaultBps": null,
        "maxBps": 5000
      },
      "features": {
        "quantumSwap": false
      },
      "defaultPair": {
        "inputMint": "So11111111111111111111111111111111111111112",
        "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
      }
    }
    curl "$QSWAP_API/config"
  • GET/tokens

    Jupiter's verified token list, trimmed. Cached 10 minutes on the server.

    Parameters
    • listqueryverifiedrequired
    Responses
    200{ tokens: Token[] }400Error429Error502Error
    Example
    {
      "tokens": [
        {
          "mint": "So11111111111111111111111111111111111111112",
          "symbol": "SOL",
          "name": "Wrapped SOL",
          "decimals": 9,
          "icon": "https://…",
          "verified": true,
          "tags": [
            "verified"
          ],
          "usdPrice": 141.2,
          "organicScore": 98.1,
          "audit": {
            "isSus": false,
            "mintAuthorityDisabled": true,
            "freezeAuthorityDisabled": true
          }
        }
      ]
    }
    curl "$QSWAP_API/tokens?list=verified"
  • GET/tokens/search

    Search by symbol, name, or up to 100 comma-separated mints. Cached 60 s per query.

    Parameters
    • queryquerystringrequiredText or mint list
    Responses
    200{ tokens: Token[] }400Error429Error502Error
    Example
    {
      "tokens": [
        {
          "mint": "So11111111111111111111111111111111111111112",
          "symbol": "SOL",
          "name": "Wrapped SOL",
          "decimals": 9,
          "icon": "https://…",
          "verified": true,
          "tags": [
            "verified"
          ],
          "usdPrice": 141.2,
          "organicScore": 98.1,
          "audit": {
            "isSus": false,
            "mintAuthorityDisabled": true,
            "freezeAuthorityDisabled": true
          }
        }
      ]
    }
    curl "$QSWAP_API/tokens/search?query=USDC"
  • GET/prices

    USD prices from Jupiter Price v3. Mints with no price are omitted. Cached 10 s.

    Parameters
    • mintsquerystringrequiredComma list, up to 50
    Responses
    200400Error429Error502Error
    Example
    {
      "prices": {
        "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": {
          "usdPrice": 1,
          "priceChange24h": 0.01
        }
      }
    }
    curl "$QSWAP_API/prices?mints=So11111111111111111111111111111111111111112,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
  • GET/balances/:owner

    SOL and SPL / Token-2022 balances from Solana RPC. Zero balances are dropped.

    Parameters
    • ownerpathbase58 addressrequired
    Responses
    200400Error429Error502Error
    Example
    {
      "owner": "…",
      "solLamports": "123",
      "tokens": [
        {
          "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
          "amount": "1000000",
          "decimals": 6
        }
      ]
    }
    curl "$QSWAP_API/balances/<owner>"
  • GET/swap/order

    Proxies Jupiter GET /swap/v2/order (ExactIn). Without taker it is a quote and transaction is null. Adds the referral fee when one is configured.

    Parameters
    • inputMintquerybase58 mintrequired
    • outputMintquerybase58 mintrequired
    • amountquerystringrequiredSmallest units of inputMint
    • takerquerybase58 addressOmit for a quote
    • slippageBpsqueryintegerOmit for auto (RTSE)
    Responses
    200Order400Error404Error429Error502Error
    Example
    {
      "requestId": "…",
      "inputMint": "So11111111111111111111111111111111111111112",
      "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "inAmount": "10000000000",
      "outAmount": "1412380000",
      "otherAmountThreshold": "1405318100",
      "slippageBps": 50,
      "priceImpact": -0.04,
      "inUsdValue": 1412.6,
      "outUsdValue": 1412.38,
      "feeBps": 10,
      "feeMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "router": "metis",
      "gasless": false,
      "routePlan": [
        {
          "label": "Raydium CLMM",
          "ammKey": "…",
          "inputMint": "So11111111111111111111111111111111111111112",
          "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
          "inAmount": "5500000000",
          "outAmount": "…",
          "percent": 55
        }
      ],
      "transaction": null,
      "lastValidBlockHeight": null,
      "expireAt": null
    }
    curl "$QSWAP_API/swap/order?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=1000000000"
  • POST/swap/execute

    Proxies Jupiter POST /swap/v2/execute. A Failed status is still HTTP 200, with code and error filled in.

    Parameters
    No parameters
    Request body · { signedTransaction, requestId }
    {
      "signedTransaction": "<base64>",
      "requestId": "…"
    }
    Responses
    200ExecuteResult400Error502Error
    Example
    {
      "status": "Success",
      "signature": "…",
      "slot": "…",
      "code": 0,
      "error": null,
      "inputAmountResult": "10000000000",
      "outputAmountResult": "1411902000"
    }
    curl -X POST "$QSWAP_API/swap/execute" \
      -H 'content-type: application/json' \
      -d '{"signedTransaction":"<base64>","requestId":"<requestId>"}'
  • POST/rpc

    JSON-RPC passthrough to the server's Solana RPC, for an allowlist of read and simulate methods. Others: -32601.

    Parameters
    No parameters
    Request body · JSON-RPC 2.0
    {
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getLatestBlockhash",
      "params": []
    }
    Responses
    200
    curl -X POST "$QSWAP_API/rpc" \
      -H 'content-type: application/json' \
      -d '{"jsonrpc":"2.0","id":1,"method":"getSlot"}'
Source: docs/API-CONTRACT.md

Rate limits and caching

Jupiter rate limits, per organisation
PlanRequests per second
Keyless0.5
Free1
Developer10
Launch50

POST /swap/v2/execute has its own, larger bucket.

What the API caches, so one user isn't one Jupiter call
Verified list10 min
Token search, per query60 s
Prices10 s
Config, in the browser5 min
Source: developers.jup.ag · docs/API-CONTRACT.md

The API returns 429 RATE_LIMITED with a Retry-After header when Jupiter's limit is hit. Jupiter's own headers are x-ratelimit-remaining and x-ratelimit-reset.