GET v1/Datasets/:Id/Items
GET
https://api.subworkflow.ai/v1/datasets/:id/items
Get a list of datasets items for a dataset
Summary
- Use "row" to specify the file format eg. "pdf" or "jpg"
- Use the "cols" to retrieve either a individual or a range of pages. eg.
cols=1,2for individual,cols=1:10for range. - The dataset property
itemCountgives you the maxcollimit but you can also fetch until you have no results. - Paginate through the list using the offet and limit query parameters.
Parameters
| name | type | location | required | description |
|---|---|---|---|---|
| row | string | query | optional | The format of the dataset items. One of 'pdf','jpg','embedding_image' are supported for the beta. |
| cols | string | query | optional | A comma-delimited expression for individual and/or a range of items. Page ranges are inclusive. eg. 1:10 will fetch 11 pages. |
| offset | number | query | optional | offset to return results from. |
| limit | number | query | optional | limit the number of returned results. Max 100. |
| sort | string | query | optional | determines which properties to sort the results. comma-delimited for multiple properties. prefix with - for descending. eg. -createdAt for descending by created date. |
| expiresInSeconds | number | query | optional | Sets the expiry duration for dataset asset share links in seconds. eg. 60 is a duration of 1 minute. Default duration is 10 minutes. |
Response
- Success
- 400 Error
- 404 Error
{
"type": "object",
"properties": {
"sort": {
"type": "array",
"items": { "type": "string" }
}
"offset": { "type": "number" },
"limit": { "type": "number" },
"total": { "type": "number" },
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"col": {
"type": "number"
},
"row": {
"type": "string"
},
"createdAt": {
"type": "number"
},
"share": {
"type": "object",
"propeties": {
"url": { "type": "string" },
"token": { "type": "string" },
"expiresAt": { "type": "number", "nullable": true }
}
}
}
}
}
}
}
{
"success": { "type": "boolean" },
"error": { "type": "string" }
}
{
"success": { "type": "boolean" },
"error": { "type": "string" }
}
Example
- Curl
- JS/TS
curl https://api.subworkfow.ai/v1/datasets/ds_ar7e4PtGX7fGGnSt/items?rows=pdf&cols=5:10,16
--header 'x-api-key: <YOUR-API-KEY>'
const req = await fetch("https://api.subworkfow.ai/v1/datasets/ds_ar7e4PtGX7fGGnSt/items?rows=pdf&cols=5:10,16", {
method: "GET",
headers: { "x-api-key": "<YOUR-API-KEY>" }
});
{
"sort": ["-createdAt"],
"offset": 0,
"limit": 10,
"total": 6,
"data": [
{
"id": "dsx_1J5Iq9Ra2OqJQwCZ",
"col": 5,
"row": "pdf",
"createdAt": 1761933154885,
"share": {
"url": "https://api.subworkflow.ai/v1/share/dsx_1J5Iq9Ra2OqJQwCZ?token=Tue9PO",
"token": "Tue9PO",
"expiresAt": 1762013710312
}
},
// ... shortened for brevity
]
}