Table of Contents

Import URLs 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

Refer to the following sample JSON to import images, video, and text.

Images
[ 
{
"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"
}
]

Where:

  • externalId is OPTIONAL and is a user-generated file name or ID for the file.
  • imageUrl is REQUIRED and accepts an https:// path to an external image URL.
Videos
[
{
"externalId": "google-cast.mp4",
"videoUrl": "https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/dash/DesigningForGoogleCastVideo.mp4"
},
{
"externalId": "bigger-blazes-video.mp4",
"videoUrl": "https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/dash/ForBiggerBlazesVideo.mp4"
}
]

Where:

  • externalId is OPTIONAL and is a user-generated file name or ID for the file.
  • videoUrl is REQUIRED and accepts an https:// path to an external video URL.
Text
[ 
{
"data": "Lucy has a set of medical conditions that are summarized as HERNS.\nIn 1996, Lucy experienced a minor stroke, which caused temporary paralysis in her left arm.\n3 years ago, Lucy was diagnosed as lupus carrier. Since the diagnosis, Lucy has been taking Warfarin and she expects to maintain Warfarin therapy for life."
},
{
"data": "https://storage.googleapis.com/labelbox-sample-datasets/nlp/lorem-ipsum.txt"
}
]

Where:

  • data is REQUIRED and accepts a text string or an https:// path to an external text file URL.

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.

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 JSON containing image URLs or local files via the 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?

Upload data via app

Asset metadata & image overlay (beta)

Contact