Skip to main content
The DatasetsResource provides methods to create, list, and retrieve datasets, as well as manage dataset items and sequences.

Create a dataset

Create a new dataset with the specified configuration.
const dataset = await avala.datasets.create({
  name: "My Dataset",
  slug: "my-dataset",
  dataType: "image",
  isSequence: false,
  visibility: "private"
});

Parameters

name
string
required
The name of the dataset
slug
string
required
The URL-friendly identifier for the dataset
dataType
string
required
The type of data in the dataset (e.g., “image”, “video”, “text”)
isSequence
boolean
Whether the dataset contains sequences
visibility
string
The visibility level of the dataset (e.g., “private”, “public”)
createMetadata
boolean
Whether to create metadata for the dataset
providerConfig
Record<string, unknown>
Configuration for the storage provider
ownerName
string
The name of the dataset owner

Returns

uid
string
The unique identifier for the dataset
name
string
The name of the dataset
slug
string
The URL-friendly identifier
itemCount
number
The number of items in the dataset
dataType
string | null
The type of data in the dataset
createdAt
string | null
The timestamp when the dataset was created
updatedAt
string | null
The timestamp when the dataset was last updated

List datasets

Retrieve a paginated list of datasets with optional filtering.
const response = await avala.datasets.list({
  dataType: "image",
  status: "active",
  limit: 50
});

Parameters

dataType
string
Filter by data type
name
string
Filter by dataset name
status
string
Filter by status
visibility
string
Filter by visibility level
limit
number
Maximum number of results to return
cursor
string
Cursor for pagination

Returns

items
Dataset[]
Array of dataset objects
nextCursor
string | null
Cursor for the next page of results
previousCursor
string | null
Cursor for the previous page of results
hasMore
boolean
Whether there are more results available

Get a dataset

Retrieve a specific dataset by its unique identifier.
const dataset = await avala.datasets.get("dataset_uid");

Parameters

uid
string
required
The unique identifier of the dataset

Returns

Returns a Dataset object.

List dataset items

Retrieve a paginated list of items in a dataset.
const response = await avala.datasets.listItems(
  "owner_name",
  "dataset-slug",
  { limit: 100 }
);

Parameters

owner
string
required
The name of the dataset owner
slug
string
required
The dataset slug
limit
number
Maximum number of items to return
cursor
string
Cursor for pagination

Returns

items
DatasetItem[]
Array of dataset item objects
nextCursor
string | null
Cursor for the next page of results
previousCursor
string | null
Cursor for the previous page of results
hasMore
boolean
Whether there are more results available

Get a dataset item

Retrieve a specific item from a dataset.
const item = await avala.datasets.getItem(
  "owner_name",
  "dataset-slug",
  "item_uid"
);

Parameters

owner
string
required
The name of the dataset owner
slug
string
required
The dataset slug
itemUid
string
required
The unique identifier of the item

Returns

Returns a DatasetItem object with fields including uid, key, url, metadata, annotations, and timestamps.

List dataset sequences

Retrieve a paginated list of sequences in a dataset.
const response = await avala.datasets.listSequences(
  "owner_name",
  "dataset-slug",
  { limit: 50 }
);

Parameters

owner
string
required
The name of the dataset owner
slug
string
required
The dataset slug
limit
number
Maximum number of sequences to return
cursor
string
Cursor for pagination

Returns

items
DatasetSequence[]
Array of dataset sequence objects
nextCursor
string | null
Cursor for the next page of results
previousCursor
string | null
Cursor for the previous page of results
hasMore
boolean
Whether there are more results available

Get a dataset sequence

Retrieve a specific sequence from a dataset.
const sequence = await avala.datasets.getSequence(
  "owner_name",
  "dataset-slug",
  "sequence_uid"
);

Parameters

owner
string
required
The name of the dataset owner
slug
string
required
The dataset slug
sequenceUid
string
required
The unique identifier of the sequence

Returns

Returns a DatasetSequence object with fields including uid, key, status, numberOfFrames, views, and frames.

Build docs developers (and LLMs) love