Get All Examples

Returns all the examples for the specified dataset. By default, returns examples created by uploading them from a .zip file.

Response Body

Name

Type

Description

Available Version

data

array

Array of example objects.

1.0

object

string

Object returned; in this case, list.

1.0

Example Response Body

Name

Type

Description

Available Version

createdAt

date

Date and time that the example was created.

1.0

id

long

ID of the example.

1.0

label

object

Label that the example is associated with.

1.0

location

string

URL of the image in the dataset. This is a temporary URL that expires in 30 minutes. This URL can be used to display in a UI images that were uploaded to a dataset.

1.0

name

string

Name of the example.

1.0

object

string

Object returned; in this case, example.

1.0

Label Response Body

Name

Type

Description

Available Version

datasetId

long

ID of the dataset that the label belongs to.

1.0

id

long

ID of the label.

1.0

name

string

Name of the label.

1.0

numExamples

int

Number of examples that have the label.

1.0

Page Through Examples

By default, this call returns 100 examples. If you want to page through the examples in a dataset, use the offset and count query parameters.

Name

Type

Description

Available Version

count

int

Number of examples to return. Maximum valid value is 100. If you specify a number greater than 100, the call returns 100 examples. Optional.

1.0

offset

int

Index of the example from which you want to start paging. Optional.

1.0

The following call shows how to page through examples using these query parameters. If you omit the count parameter, the API returns 100 examples. If you omit the offset parameter, paging starts at 0.

curl -X GET -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache"  "https://api.einstein.ai/v2/vision/datasets/57/examples?offset=100&count=50"

How Paging Works

To page through all the examples in a dataset:

  1. Make the Get a Dataset call to return the totalExamples value for the dataset.
  2. Make the Get All Examples call and pass in the offset and count values until you reach the end of the examples.

For example, let's say you have a dataset and you want to display information about the examples in a UI and show 50 at a time. The first call would have offset=0 and count=50, the second call would have offset=50 and count=50, and so on.

Return Specific Example Types

By default, this call returns examples created by uploading images from a .zip file (using either POST or PUT). Use the source query parameter to return examples that were created in the dataset as feedback. The source query parameter is available in Einstein Vision API version 2.0 and later. Valid values for the source parameter are:

  • all—Return both upload and feedback examples.
  • feedback—Return examples that were created as feedback.
  • upload—Return examples that were created from uploading a .zip file.

This cURL call returns only feedback examples.

curl -X GET -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" https://api.einstein.ai/v2/vision/datasets/57/examples?source=feedback

Limits

Each Einstein Platform Services account is limited to 30 calls per calendar month to Einstein Vision and Einstein Language endpoints that return examples.

This limit applies across all APIs that return examples. If you exceed this limit, you receive an error message. See Release Notes.

Language