DatasetClient <Data>
Hierarchy
- ResourceClient
- DatasetClient
Index
Properties
inheritedapifyClient
inheritedbaseUrl
inheritedhttpClient
optionalinheritedid
optionalinheritedparams
inheritedpublicBaseUrl
inheritedresourcePath
optionalinheritedsafeId
inheritedurl
Methods
createItemsPublicUrl
Generates a public URL for accessing dataset items.
If the client has permission to access the dataset's URL signing key, the URL will include a cryptographic signature allowing access without authentication. This is useful for sharing dataset results with external services or users.
Parameters
options: DatasetClientCreateItemsUrlOptions = {}
URL generation options (extends all options from listItems)
Returns Promise<string>
A public URL string for accessing the dataset items
delete
Deletes the dataset.
Returns Promise<void>
downloadItems
Downloads dataset items in a specific format.
Unlike listItems which returns a PaginatedList with an array of individual dataset items, this method returns the items serialized to the provided format (JSON, CSV, Excel, etc.) as a Buffer. Useful for exporting data for further processing.
Parameters
format: DownloadItemsFormat
Output format:
'json','jsonl','csv','xlsx','xml','rss', or'html'options: DatasetClientDownloadItemsOptions = {}
Download and formatting options (extends all options from listItems)
Returns Promise<Buffer>
Buffer containing the serialized data in the specified format
get
Gets the dataset object from the Apify API.
Returns Promise<undefined | Dataset>
The Dataset object, or
undefinedif it does not exist
getStatistics
Gets statistical information about the dataset.
Returns statistics for each field in the dataset, including information about data types, null counts, and value ranges.
Returns Promise<undefined | DatasetStatistics>
Dataset statistics, or
undefinedif not available
listItems
Lists items in the dataset.
Returns a paginated list of dataset items. You can use pagination parameters to retrieve specific subsets of items, and various filtering and formatting options to customize the output.
Parameters
options: DatasetClientListItemOptions = {}
Options for listing items
Returns PaginatedIterator<Data>
A paginated list with
items,totalcount,offset,count, andlimit
pushItems
Stores one or more items into the dataset.
Items can be objects, strings, or arrays thereof. Each item will be stored as a separate record in the dataset. Objects are automatically serialized to JSON. If you provide an array, all items will be stored in order. This method is idempotent - calling it multiple times with the same data will not create duplicates, but will append items each time.
Parameters
items: string | Data | string[] | Data[]
A single item (object or string) or an array of items to store. Objects are automatically stringified to JSON. Strings are stored as-is.
Returns Promise<void>
update
Updates the dataset with specified fields.
Parameters
newFields: DatasetClientUpdateOptions
Fields to update in the dataset
Returns Promise<Dataset>
The updated Dataset object
Client for managing a specific Dataset.
Datasets store structured data results from Actor runs. This client provides methods to push items, list and retrieve items, download items in various formats (JSON, CSV, Excel, etc.), and manage the dataset.
https://docs.apify.com/platform/storage/dataset