Table of Contents

Import via JSON

Alex Cota Updated by Alex Cota

Uploading your data via JSON provides the most flexibility. Follow these steps to format your JSON file and import your data to Labelbox.

Step 1: Format JSON file

Include the following fields in your JSON import file. Sample import JSON for image, video, and text provided below.

externalId (OPTIONAL)

A user generated file name or ID for the file.

imageUrl

HTTPS path to the external image URL.

videoUrl

Path to the video URL.

data

The text string to be labeled.

When you import your external image URLs via JSON, you have the option to attach additional metadata information to each of your assets. To learn how to format your import file to include asset metadata, see Asset information overlay.

Image import sample
[ 
{
"externalId": "2017-Tesla-Model-S-P90D-102.jpg",
"imageUrl": "https://storage.googleapis.com/labelbox-example-datasets/tesla/2017-Tesla-Model-S-P90D-102.jpg"
},
{
"externalId": "2017-Tesla-Model-3-top-view.jpg",
"imageUrl": "https://storage.googleapis.com/labelbox-example-datasets/tesla/2017-Tesla-Model-3-top-view.jpg"
}
]
Video import sample
[
{
"externalId": "BigBuckBunny.mp4",
"videoUrl": "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
}
]
Text import sample
[ 
{
"data": "Lorem ipsum dolor sit amet..." ,
}
]

Step 2: Import JSON file

There are three methods for importing your data via JSON.

Labelbox web app

If you have a paid Labelbox account, you can upload new data via JSON or CSV in the Labelbox web app.

Python API

If you have an API key, you may import data as a JSON file using our Python API. For more detail, see the documentation for the create_data_rows() method in our Python API reference.

GraphQL API

To learn how to use the appendRowsToDataset GraphQL mutation to import a JSON file, see the Bulk import documentation.

Advanced JSON imports

  1. Asset information overlay
  2. Import image tiles
  3. Import custom data structure

Was this page helpful?

Direct upload

Asset metadata via JSON

Contact