Provides API endpoints related to api/datasets
Summary
Functions
Create dataset
Delete dataset
Get dataset
Get list of datasets
Get dataset statistics
Update dataset
Functions
@spec create(opts :: keyword()) :: {:ok, ApifyClient.Schemas.DatasetResource.t()} | {:error, ApifyClient.Error.t()}
Create dataset
Creates a dataset and returns its object. Keep in mind that data stored under unnamed dataset follows data retention period. It creates a dataset with the given name if the parameter name is used. If a dataset with the given name already exists then returns its object.
Options
name: Custom unique name to easily identify the dataset in the future.
@spec delete(dataset_id :: String.t(), opts :: keyword()) :: :ok | {:error, ApifyClient.Error.t()}
Delete dataset
Deletes a specific dataset.
@spec get(dataset_id :: String.t(), opts :: keyword()) :: {:ok, ApifyClient.Schemas.DatasetResource.t()} | {:error, ApifyClient.Error.t()}
Get dataset
Returns dataset object for given dataset ID.
This does not return dataset items, only information about the storage itself. To retrieve dataset items, use the Get dataset items endpoint.
:::note
Keep in mind that attributes itemCount and cleanItemCount are not propagated right away after data are pushed into a dataset.
:::
There is a short period (up to 5 seconds) during which these counters may not match with exact counts in dataset items.
@spec list(opts :: keyword()) :: {:ok, ApifyClient.Schemas.ListOfDatasets.t()} | {:error, ApifyClient.Error.t()}
Get list of datasets
Lists all of a user's datasets.
The response is a JSON array of objects, where each object contains basic information about one dataset.
By default, the objects are sorted by the createdAt field in ascending
order, therefore you can use pagination to incrementally fetch all datasets while new
ones are still being created. To sort them in descending order, use desc=1
parameter. The endpoint supports pagination using limit and offset
parameters and it will not return more than 1000 array elements.
Options
offset: Number of items that should be skipped at the start. The default value is0.limit: Maximum number of items to return. The default value as well as the maximum is1000.desc: Iftrueor1then the objects are sorted by thecreatedAtfield in descending order. By default, they are sorted in ascending order.unnamed: Iftrueor1then all the storages are returned. By default, only named storages are returned.ownership: Filter by ownership. If this parameter is omitted, all accessible datasets are returned.ownedByMe: Return only datasets owned by the user.sharedWithMe: Return only datasets shared with the user by other users.
@spec statistics(dataset_id :: String.t(), opts :: keyword()) :: {:ok, ApifyClient.Schemas.DatasetStatistics.t()} | {:error, ApifyClient.Error.t()}
Get dataset statistics
Returns statistics for given dataset.
Provides only field statistics.
@spec update( dataset_id :: String.t(), body :: map() | ApifyClient.Schemas.UpdateDatasetRequest.t(), opts :: keyword() ) :: {:ok, ApifyClient.Schemas.DatasetResource.t()} | {:error, ApifyClient.Error.t()}
Update dataset
Updates a dataset's name and general resource access level using a value specified by a JSON object passed in the PUT payload. The response is the updated dataset object, as returned by the Get dataset API endpoint.
Request Body
Content Types: application/json