Marketplace Download API
Download data from Promethium's Data Marketplace in various formats. Marketplace items may contain single or multiple queries, with multi-query items automatically packaged as ZIP archives.
Endpoints
| Endpoint | Description |
|---|---|
POST /marketplace/{id}/download/csv | Download as CSV |
POST /marketplace/{id}/download/json | Download as JSON |
POST /marketplace/download?id={id}&format={format} | Generic download endpoint |
Headers
| Header Name | Value | Required | Description |
|---|---|---|---|
idtoken | <authentication_id_token> | ✅ | JWT token obtained via login |
See Trino Stream Authentication for alternative authentication methods (HTTP Basic, Bearer token).
CSV Download
Endpoint
POST https://<tenant>-trino-stream.<env>.promethium.ai/marketplace/{id}/download/csv
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | Marketplace item ID |
Example Response
✅ Success (200 OK)
Single Query: Returns a CSV file with Content-Type: text/csv
Multiple Queries: Returns a ZIP archive with Content-Type: application/zip
JSON Download
Endpoint
POST https://<tenant>-trino-stream.<env>.promethium.ai/marketplace/{id}/download/json
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | Marketplace item ID |
Example Response
✅ Success (200 OK)
{
"metadata": {
"columns": [
{"name": "product_id", "type": "bigint"},
{"name": "product_name", "type": "varchar"},
{"name": "price", "type": "decimal(10,2)"}
],
"type": "metadata"
},
"data": [
{"product_id": 501, "product_name": "Wireless Mouse", "price": 29.99},
{"product_id": 502, "product_name": "USB-C Cable", "price": 12.50}
]
}
Generic Download Endpoint
A query-parameter-based endpoint for flexible format selection.
Endpoint
POST https://<tenant>-trino-stream.<env>.promethium.ai/marketplace/download
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | Marketplace item ID |
format | string | ✅ | Output format: csv, json, xlsx, or xl |
Example: curl
Download CSV
curl -X POST https://<tenant>-trino-stream.<env>.promethium.ai/marketplace/abc123/download/csv \
-H "idtoken: YOUR_ID_TOKEN_HERE" \
--output marketplace_data.csv
Download JSON
curl -X POST https://<tenant>-trino-stream.<env>.promethium.ai/marketplace/abc123/download/json \
-H "idtoken: YOUR_ID_TOKEN_HERE" \
--output marketplace_data.json
Download via Generic Endpoint
curl -X POST "https://<tenant>-trino-stream.<env>.promethium.ai/marketplace/download?id=abc123&format=csv" \
-H "idtoken: YOUR_ID_TOKEN_HERE" \
--output data.csv