<!-- ZenPays documentation · https://docs.zenpayz.com/docs/rest-api/endpoints/ramp/buy-prices -->

# Get Buy Prices

Get the current price of crypto assets in fiat. Returns the price per 1 unit of each crypto asset.

<EndpointHeader verb="GET" path="/payment/api/v1/on-ramp/prices" />

## Request

### Headers

<ParamTable
  label="Header"
  rows={[
    { name: "x-request-id", desc: "Custom request ID for tracing" },
  ]}
/>

:::note Public Endpoint
This endpoint does not require authentication headers.
:::

### Query Parameters

<ParamTable
  rows={[
    { name: "assets", type: "string", required: true, desc: "Comma-separated crypto IDs (e.g. `btc_bitcoin,eth_ethereum`)" },
    { name: "fiat", type: "string", required: true, desc: "Fiat currency (e.g. `usd`)" },
    { name: "country", type: "string", desc: "ISO country code" },
  ]}
/>

## Response

### Success (200 OK)

```json
{
  "success": true,
  "data": [
    {
      "asset": "btc_bitcoin",
      "fiat": "usd",
      "price": 89285.71,
      "timestamp": "2026-03-11T04:44:00.000Z"
    },
    {
      "asset": "eth_ethereum",
      "fiat": "usd",
      "price": 3200.50,
      "timestamp": "2026-03-11T04:44:00.000Z"
    }
  ],
  "message": "Prices retrieved"
}
```

### Response Fields

<ParamTable
  rows={[
    { name: "asset", type: "string", desc: "Crypto asset ID" },
    { name: "fiat", type: "string", desc: "Fiat currency" },
    { name: "price", type: "number", desc: "Price of 1 unit of crypto in fiat" },
    { name: "timestamp", type: "string", desc: "ISO 8601 timestamp" },
  ]}
/>

### Error Responses

<ErrorTable
  rows={[
    { code: "RAMP_PRICES_FAILED", status: "500", message: "Failed to get prices" },
  ]}
/>

<CodeRail>

## Examples

<Tabs groupId="language">
  <TabItem value="curl" label="cURL" default>

```bash
curl "https://api.zenpayz.com/payment/api/v1/on-ramp/prices?assets=btc_bitcoin,eth_ethereum&fiat=usd"
```

  </TabItem>
  <TabItem value="javascript" label="JavaScript">

```javascript
const params = new URLSearchParams({
  assets: 'btc_bitcoin,eth_ethereum',
  fiat: 'usd',
});

const response = await fetch(
  `https://api.zenpayz.com/payment/api/v1/on-ramp/prices?${params}`
);
const { data: prices } = await response.json();

prices.forEach(p => {
  console.log(`${p.asset}: $${p.price.toLocaleString()}`);
});
// btc_bitcoin: $89,285.71
// eth_ethereum: $3,200.50
```

  </TabItem>
  <TabItem value="python" label="Python">

```python
import requests

response = requests.get(
    "https://api.zenpayz.com/payment/api/v1/on-ramp/prices",
    params={"assets": "btc_bitcoin,eth_ethereum", "fiat": "usd"},
)
prices = response.json()["data"]

for p in prices:
    print(f"{p['asset']}: ${p['price']:,.2f}")
```

  </TabItem>
</Tabs>

</CodeRail>

## Next Steps

- [Buy Quotes](/docs/rest-api/endpoints/ramp/buy-quotes) -- Get detailed quotes with fees
- [Buy Rates](/docs/rest-api/endpoints/ramp/buy-rates) -- Get rates with fee breakdown
