Expand Options
Markets
Retrieve markets data for an asset using the expand parameter
GET
/
v1
/
assets
/
{idOrSlug}
Get Asset
curl --request GET \
--url https://api.blockworks.com/v1/assets/{idOrSlug} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.blockworks.com/v1/assets/{idOrSlug}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.blockworks.com/v1/assets/{idOrSlug}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 2147483647,
"code": "<string>",
"title": "<string>",
"slug": "<string>",
"tag_line": "<string>",
"description": "<string>",
"image_url": "<string>",
"sector": "<string>",
"category": "<string>",
"updated_at": 123,
"type": "Infrastructure",
"market_cap": {
"asset_id": 2147483647,
"rank": 2147483647,
"usd": 8.988465674311579e+307,
"dominance": 1.7014115e+38,
"percent_change_btc_1_h": 1.7014115e+38,
"percent_change_btc_24_h": 1.7014115e+38,
"percent_change_usd_1_h": 1.7014115e+38,
"percent_change_usd_24_h": 1.7014115e+38,
"percent_change_eth_1_h": 1.7014115e+38,
"percent_change_eth_24_h": 1.7014115e+38,
"updated_at": 123
},
"price": {
"asset_id": 2147483647,
"usd": 8.988465674311579e+307,
"btc": 8.988465674311579e+307,
"eth": 8.988465674311579e+307,
"sparkline_7d": "<string>",
"updated_at": 123
}
}Overview
Add the?expand=markets flag to your /assets or /assets/{idOrSlug} page to include markets data in the response.
Example Request
curl -H "x-api-key: YOUR_API_KEY" \
"https://api.blockworks.com/v1/assets/ethereum?expand=markets"
const res = await fetch(
'https://api.blockworks.com/v1/assets/ethereum?expand=markets',
{ headers: { 'x-api-key': 'YOUR_API_KEY' } }
)
const data = await res.json()
import requests
r = requests.get(
'https://api.blockworks.com/v1/assets/ethereum',
headers={'x-api-key': 'YOUR_API_KEY'},
params={'expand': 'markets'}
)
data = r.json()
Example Response
{
"id": 2,
"code": "ETH",
"title": "Ethereum",
"slug": "ethereum",
... // other asset data
"markets": {
"volume_24h": 44151100000,
"ath": 4946.05,
"ath_change_percentage": -21.1244,
"ath_date": 1756063263,
"total_open_interest": 1707980000,
"total_liquidations": 0,
"updated_at": 1760640287
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
volume_24h | number | Trading volume in the last 24 hours |
ath | number | All-time high price |
ath_change_percentage | number | Percentage change from all-time high |
ath_date | number | Unix timestamp when all-time high was reached |
total_open_interest | number | Total open interest |
total_liquidations | number | Total liquidations |
updated_at | number | Unix timestamp when market data was last updated |
Notes
- Can be used with other expansion options by joining with a comma (e.g.
?expand=markets,ohlcv_last_24h). - Can be used on
/v1/assets/or/v1/assets/{idOrSlug}endpoints. priceandmarket_capare expanded by default in/assets/{idOrSlug}results unless an explicit?expand=flag is provided.
See also
Authorizations
Path Parameters
Query Parameters
Available options:
addresses, chains, addresses.chain, markets, market_cap, ohlcv_last_24_h, price, reference, sector, supply Response
Required range:
0 <= x <= 4294967295Maximum string length:
20Maximum string length:
100Maximum string length:
100Maximum string length:
255Maximum string length:
65535Maximum string length:
255Maximum string length:
50Maximum string length:
25Unix timestamp
Available options:
Infrastructure, Application Expandable relationship
Show child attributes
Show child attributes
Expandable relationship
Show child attributes
Show child attributes