Upload and retrieve data with Viam's data client API | APIs

Upload and retrieve data with Viam's data client API

The data client allows you to upload and retrieve data to and from the Viam Cloud.

The data client API supports the following methods:

Methods to upload data like images or sensor readings directly to Viam:

Method Name Description
BinaryDataCaptureUpload Upload binary data collected on your machine through a specific component and the relevant metadata to Viam.
TabularDataCaptureUpload Upload tabular data collected on your machine through a specific component to Viam.
FileUpload Upload arbitrary files stored on your machine to Viam by file name.
FileUploadFromPath Upload files stored on your machine to Viam by filepath.
StreamingDataCaptureUpload Upload the contents of streaming binary data and the relevant metadata to Viam.

Methods to download, filter, tag, or perform other tasks on data like images or sensor readings:

Method Name Description
GetLatestTabularData Gets the most recent tabular data captured from the specified data source, as long as it was synced within the last year.
ExportTabularData Obtain unified tabular data and metadata from the specified data source.
TabularDataByFilter Retrieve optionally filtered tabular data from Viam.
TabularDataBySQL Obtain unified tabular data and metadata, queried with SQL. Make sure your API key has permissions at the organization level in order to use this.
TabularDataByMQL Obtain unified tabular data and metadata, queried with MQL.
BinaryDataByFilter Retrieve optionally filtered binary data from Viam.
BinaryDataByIDs Retrieve binary data from Viam by BinaryID.
DeleteTabularData Delete tabular data older than a specified number of days.
DeleteBinaryDataByFilter Filter and delete binary data.
DeleteBinaryDataByIDs Filter and delete binary data by ids.
AddTagsToBinaryDataByIDs Add tags to binary data by ids.
RemoveTagsFromBinaryDataByIDs Remove tags from binary by ids.
TagsByFilter Get a list of tags using a filter.
AddBoundingBoxToImageByID Add a bounding box to an image specified by its BinaryID.
RemoveBoundingBoxFromImageByID Removes a bounding box from an image specified by its BinaryID.
BoundingBoxLabelsByFilter Get a list of bounding box labels using a Filter.
GetDatabaseConnection Get a connection to access a MongoDB Atlas Data federation instance.
ConfigureDatabaseUser Configure a database user for the Viam organization’s MongoDB Atlas Data Federation instance.
AddBinaryDataToDatasetByIDs Add the BinaryData to the provided dataset.
RemoveBinaryDataFromDatasetByIDs Remove the BinaryData from the provided dataset.
GetDataPipeline Get the configuration for a data pipeline.
ListDataPipelines List all of the data pipelines in an organization.
CreateDataPipeline Create a data pipeline.
DeleteDataPipeline Delete a data pipeline, its execution history, and all of its output data.
ListDataPipelineRuns Get information about individual executions of a data pipeline.
RenameDataPipeline Rename a data pipeline.
AddTagsToBinaryDataByFilter Add tags to binary data by filter.
CreateBinaryDataSignedURL Create a signed URL for accessing binary data without authentication. The URL expires after the specified duration.
CreateIndex Create a custom index on your data to speed up queries. You specify the organization, the collection type (tabular or binary), and the fields to index.
DeleteIndex Delete a custom index from your data.
ListIndexes List all custom indexes for an organization.
RemoveTagsFromBinaryDataByFilter Remove tags from binary data by filter.
UpdateBoundingBox Update an existing bounding box on an image. You can change the label, position, or dimensions of the bounding box.

Methods to work with datasets:

Method Name Description
CreateDataset Create a new dataset.
DeleteDataset Delete a dataset.
RenameDataset Rename a dataset specified by the dataset ID.
ListDatasetsByOrganizationID Get the datasets in an organization.
ListDatasetsByIDs Get a list of datasets using their IDs.

Establish a connection

To use the data client API, you need to instantiate a ViamClient and then instantiate a DataClient.

You need an API key and API key ID with at least Machine operator permissions to use the data client API. To get an API key (and corresponding ID), use the web UI to the Viam CLI.


Copy


Copy


Copy

See Use platform APIs from within a module.

Once you have instantiated a DataClient, you can run API methods against the DataClient object (named data_client in the examples).

API

BinaryDataCaptureUpload

Upload binary data collected on your machine through a specific component and the relevant metadata to Viam. Uploaded binary data can be found under the Images, Point clouds, or Files subtab of the Data tab, depending on the type of data that you upload.

Parameters:

Returns:

Raises:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

TabularDataCaptureUpload

Upload tabular data collected on your machine through a specific component to Viam. Uploaded tabular data can be found under the Sensors subtab of the Data tab.

Size limit

Viam enforces a maximum size of 4MB for any single reading for tabular data.

Parameters:

Returns:

Raises:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

FileUpload

Upload arbitrary files stored on your machine to Viam by file name. If uploaded with a file extension of .jpeg/.jpg/.png, uploaded files can be found in the Images subtab of the app’s Data tab. If .pcd, the uploaded files can be found in the Point clouds subtab. All other types of uploaded files can be found under the Files subtab of the app’s Data tab.

Parameters:

Returns:

Raises:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

FileUploadFromPath

Upload files stored on your machine to Viam by filepath. Uploaded files can be found under the Files subtab of the Data tab.

Parameters:

Returns:

Raises:

Example:


Copy

For more information, see the Python SDK Docs.

StreamingDataCaptureUpload

Upload the contents of streaming binary data and the relevant metadata to Viam. Uploaded streaming data can be found under the Data tab.

Parameters:

Returns:

Raises:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

GetLatestTabularData

Gets the most recent tabular data captured from the specified data source, as long as it was synced within the last year.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

ExportTabularData

Obtain unified tabular data and metadata from the specified data source.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

TabularDataByFilter

Retrieve optionally filtered tabular data from Viam. You can also find your tabular data under the Sensors subtab of the Data tab.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

TabularDataBySQL

Obtain unified tabular data and metadata, queried with SQL. Make sure your API key has permissions at the organization level in order to use this.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

TabularDataByMQL

Obtain unified tabular data and metadata, queried with MQL.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

BinaryDataByFilter

Retrieve optionally filtered binary data from Viam. You can also find your binary data under the Images, Point clouds, or Files subtab of the Data tab, depending on the type of data that you have uploaded.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

BinaryDataByIDs

Retrieve binary data from Viam by BinaryID. You can also find your binary data under the Images, Point clouds, or Files subtab of the app’s Data tab, depending on the type of data that you have uploaded.

Parameters:

Returns:

Raises:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

DeleteTabularData

Delete tabular data older than a specified number of days. If the organization has a hot data store, matching data is deleted from that store as well.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

DeleteBinaryDataByFilter

Filter and delete binary data.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

DeleteBinaryDataByIDs

Filter and delete binary data by ids.

Parameters:

Returns:

Raises:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

AddTagsToBinaryDataByIDs

Add tags to binary data by ids.

Parameters:

Returns:

Raises:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

RemoveTagsFromBinaryDataByIDs

Remove tags from binary by ids.

Parameters:

Returns:

Raises:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

TagsByFilter

Get a list of tags using a filter.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

AddBoundingBoxToImageByID

Add a bounding box to an image specified by its BinaryID.

Parameters:

Returns:

Raises:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

RemoveBoundingBoxFromImageByID

Removes a bounding box from an image specified by its BinaryID.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

BoundingBoxLabelsByFilter

Get a list of bounding box labels using a Filter.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

GetDatabaseConnection

Get a connection to access a MongoDB Atlas Data federation instance.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

ConfigureDatabaseUser

Configure a database user for the Viam organization’s MongoDB Atlas Data Federation instance. It can also be used to reset the password of the existing database user.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

AddBinaryDataToDatasetByIDs

Add the BinaryData to the provided dataset. This BinaryData will be tagged with the VIAM_DATASET_{id} label.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

RemoveBinaryDataFromDatasetByIDs

Remove the BinaryData from the provided dataset. This BinaryData will lose the VIAM_DATASET_{id} tag.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

GetDataPipeline

Get the configuration for a data pipeline.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

ListDataPipelines

List all of the data pipelines in an organization.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

CreateDataPipeline

Create a data pipeline.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

DeleteDataPipeline

Delete a data pipeline, its execution history, and all of its output data.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

ListDataPipelineRuns

Get information about individual executions of a data pipeline.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

RenameDataPipeline

Rename a data pipeline.

Parameters:

Returns:

For more information, see the Go SDK Docs.

AddTagsToBinaryDataByFilter

Add tags to binary data by filter.

Parameters:

Returns:

Raises:

Example:


Copy

For more information, see the Python SDK Docs.

CreateBinaryDataSignedURL

Create a signed URL for accessing binary data without authentication. The URL expires after the specified duration.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

CreateIndex

Create a custom index on your data to speed up queries. You specify the organization, the collection type (tabular or binary), and the fields to index.

Parameters:

Returns:

For more information, see the Python SDK Docs.

DeleteIndex

Delete a custom index from your data.

Parameters:

Returns:

For more information, see the Python SDK Docs.

ListIndexes

List all custom indexes for an organization.

Parameters:

Returns:

For more information, see the Python SDK Docs.

RemoveTagsFromBinaryDataByFilter

Remove tags from binary data by filter.

Parameters:

Returns:

Raises:

Example:


Copy

For more information, see the Python SDK Docs.

UpdateBoundingBox

Update an existing bounding box on an image. You can change the label, position, or dimensions of the bounding box.

Parameters:

Returns:

Raises:

Example:


Copy

For more information, see the Python SDK Docs.

CreateDataset

Create a new dataset.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

DeleteDataset

Delete a dataset.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

RenameDataset

Rename a dataset specified by the dataset ID.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

ListDatasetsByOrganizationID

Get the datasets in an organization.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

ListDatasetsByIDs

Get a list of datasets using their IDs.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Flutter SDK Docs.

Ask AI

Was this page helpful?

YesNo

Glad to hear it! If you have any other feedback please let us know:

Send

We're sorry about that. To help us improve, please tell us what we can do better:

Send

Thank you!