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

# Market API Python example

> End-to-end Python example: call the Velora Market API to quote 1 ETH → USDC via requests.

A minimal Python script that calls `GET /prices` and prints the quoted `destAmount`. Uses `requests`.

## File tree

```text theme={null}
my-app/
├─ requirements.txt
└─ quote.py
```

## Install

```bash theme={null}
mkdir my-app && cd my-app
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install requests
```

## `quote.py`

```python theme={null}
import requests

params = {
    "srcToken":     "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",  # ETH
    "destToken":    "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",  # USDC
    "amount":       "1000000000000000000",                          # 1 ETH
    "srcDecimals":  18,
    "destDecimals": 6,
    "side":         "SELL",
    "network":      1,
    "userAddress":  "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "partner":      "my-app-name",
    "version":      "6.2",
}

res = requests.get("https://api.velora.xyz/prices", params=params, timeout=10)
res.raise_for_status()

price_route = res.json()["priceRoute"]

print("destAmount:", price_route["destAmount"])
print("gasCostUSD:", price_route["gasCostUSD"])
```

## Run it

```bash theme={null}
python quote.py
```

You should see the quoted `destAmount` (USDC, 6 decimals) and `gasCostUSD` printed.

## Next: build the transaction

Feed the `priceRoute` into `POST /transactions/:chainId` to get ready-to-broadcast calldata. See [Market API → How it works](/docs/market/how-it-works).

## Related pages

* [Market API overview](/docs/market/overview) — when to use Market routing.
* [Market API → How it works](/docs/market/how-it-works) — quote → build → broadcast flow.
* [Market API reference](/docs/api-reference/market/overview) — full parameter list.
