Skip to main content

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,2 for individual, cols=1:10 for range.
  • The dataset property itemCount gives you the max col limit but you can also fetch until you have no results.
  • Paginate through the list using the offet and limit query parameters.

Parameters

nametypelocationrequireddescription
rowstringqueryoptionalThe format of the dataset items. One of 'pdf','jpg','embedding_image' are supported for the beta.
colsstringqueryoptionalA comma-delimited expression for individual and/or a range of items. Page ranges are inclusive. eg. 1:10 will fetch 11 pages.
offsetnumberqueryoptionaloffset to return results from.
limitnumberqueryoptionallimit the number of returned results. Max 100.
sortstringqueryoptionaldetermines which properties to sort the results. comma-delimited for multiple properties. prefix with - for descending. eg. -createdAt for descending by created date.
expiresInSecondsnumberqueryoptionalSets the expiry duration for dataset asset share links in seconds. eg. 60 is a duration of 1 minute. Default duration is 10 minutes.

Response

{
"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 }
}
}
}
}
}
}
}

Example

curl https://api.subworkfow.ai/v1/datasets/ds_ar7e4PtGX7fGGnSt/items?rows=pdf&cols=5:10,16
--header '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
]
}