--- title: Get data into Label Studio short: Import data type: guide tier: all order: 157 order_enterprise: 157 meta_title: Import Data into Label Studio meta_description: Label and annotate data for your machine learning and data science projects using common file formats or the Label Studio JSON format. section: "Import & Export" --- Get data into Label Studio by importing files, referencing URLs, or syncing with cloud or database storage. - If your data is stored in a cloud storage bucket, see [Sync data from cloud or database storage](storage.html). - If your data is stored in a Redis database, see [Sync data from cloud or database storage](storage.html). - If your data is stored at internet-accessible URLs, in files, or directories, [import it from the Label Studio UI](#Import-data-from-the-Label-Studio-UI). - If your data is stored locally, [import it into Label Studio](#Import-data-from-a-local-directory). - If your data contains predictions or pre-annotations, see [Import pre-annotated data into Label Studio](predictions.html). ## General guidelines for importing data * It’s best to keep about 100k tasks / 100k annotations per project for optimal performance. * Avoid frequent imports because each new import requires lengthy background operations. One import per 30 seconds will work without overloads. !!! attention For large projects or business critical projects, do not [upload media files through the Label Studio interface](#Import-data-from-the-Label-Studio-UI). This is especially true for files such as images, audio, video, timeseries, etc. Uploading data through the Label Studio UI works fine for proof of concept projects, but it is not recommended for larger projects. Label Studio is not designed as a hosting service at scale and does not have backups for imported media resources. **Risks when uploading through the UI**:
You will face challenges when attempting to do the following: * Importing tasks with predictions * Exporting your data * Moving your data to another Label Studio instance * Redeploying Label Studio We ***strongly*** recommend that you configure [source storage](storage) instead. ## Types of data you can import into Label Studio You can import many types of data, including text, timeseries, audio, and image data. The file types supported depend on the type of data. | Data type | Supported file types | | --- | --- | | Audio | .flac, .m4a, .mp3, .ogg, .wav | | [HyperText (HTML)](#Import-HTML-data) | .html, .htm, .xml | | Images | .bmp, .gif, .jpg, .png, .svg, .webp | | Paragraphs (Dialogue) | .json | | Structured data | .csv, .tsv | | [Text](#Plain-text) | .txt, .json | | [Time series](#Import-CSV-or-TSV-data) | .csv, .tsv, .json | | [Tasks with multiple data types](#Basic-Label-Studio-JSON-format) | .csv, .tsv, .json, .jsonl*, .parquet*+ | | Video | .mp4, .webm | \* *Cloud storage only* \+ *Label Studio Enterprise and Starter Cloud only* If you don't see a supported data or file type that you want to import, please let us know by submitting an issue to the Label Studio Repository. ### How to import your data The most secure and reliable method to import your data is to store the data outside of Label Studio and import references to the data using URLs. You can import a list of URLs in a TXT, CSV, or TSV file, or reference the URLs in [JSON task format](#Basic-Label-Studio-JSON-format). If you're importing audio, image, or video data, you must use URLs to refer to those data types. If you're importing HTML, text, dialogue, or timeseries data using the ``, ``, ``, or `` tags in your labeling configuration, you can either load data directly, or load data from a URL. - To load data from a URL, specify `valueType="url"` in your labeling configuration. - To load data directly into the Label Studio database, specify `valueType="text"` for `HyperText` or `Text` data, or `valueType="json"` for `Paragraph` or `TimeSeries` data. !!! note If you load data from a URL, the data is not saved in Label Studio. If you want an annotated task export to include the data that you annotated, you must import the data into the Label Studio database without using URL references, or combine the data with the annotations after exporting.
{% details Click to expand example configurations with each valueType %} #### Example with valueType="text"
Labeling configuration: {% codeblock lang:xml %} {% endcodeblock %} JSON file to import: {% codeblock lang:json %} { "text": "My awesome opossum" } {% endcodeblock %} CSV file to import: {% codeblock lang:csv %} text My awesome opossum {% endcodeblock %}
#### Example with valueType="url"
Labeling config: {% codeblock lang:xml %} {% endcodeblock %} Import JSON file: {% codeblock lang:json %} { "text": "http://example.com/text.txt" } {% endcodeblock %} Import CSV file: {% codeblock lang:csv %} text http://example.com/text.txt {% endcodeblock %}
{% enddetails %} ## How to retrieve data There are several steps to retrieve the data to display in the `Object` tag. The data retrieval is also used in [dynamic choices](/templates/serp_ranking.html) and [labels](/templates/inventory_tracking.html). Use the following parameters in the `Object` tag. ### `value` (required) The `value` parameter represents the source of the data. It can be plain text or a step of complex data retrieval system. It can be denoted using the following forms: `value` (required) #### Variables In most cases, the `Object` tag has the value with one variable (prefixed with a $) in it. For example, `