Defining a Dataset Schema
A dataset schema lets you describe the structure of your data before uploading it. Schemas are a feature of V4 datasets and enable:
- Named, typed fields that drive what participants see
dataset_fielditems inbatch_itemsthat pull dataset values directly into your task layout- Per-record validation during import (with strict mode)
- Structured metadata and custom task grouping
Creating a dataset with a schema
Pass a schema object when creating a dataset.
Field types
Audio URL fields
Use audio_url for externally hosted source audio that participants should listen to during a Batch task.
- Prolific does not host source media.
audio_urlfields must point to audio files hosted outside Prolific. - URLs must remain valid for the full study duration. The audio URL should stay reachable and accessible from dataset import through participant completion.
- Use direct-file HTTPS URLs only. Manifest-based streaming formats such as
.m3u8and.mpdare not supported. - Supported audio formats:
.mp3,.wav,.aac, and.m4a. Access-Control-Allow-Origin(CORS): without it the audio can still play, but the player shows a generic placeholder waveform instead of the decoded waveform preview because waveform generation uses a cross-origin fetch.Cache-Controland/orETag: without cache headers the same file may be downloaded twice — once to decode the waveform and once again for playback.
Video URL fields
Use video_url for externally hosted source video that participants should watch during a Batch task.
- Prolific does not host source media.
video_urlfields must point to video files hosted outside Prolific. - URLs must remain valid for the full study duration. The video URL should stay reachable and accessible from dataset import through participant completion.
- Use direct-file HTTPS URLs only. Manifest-based streaming formats such as
.m3u8and.mpdare not supported and are rejected during dataset validation. - Supported video formats:
.mp4,.mov,.webm, and.m4v. Access-Control-Allow-Origin(CORS): without it the video can still play, but the player shows a generic placeholder poster frame instead of the real one, because the poster frame is decoded via a cross-originfetch.Cache-Controland/orETag: without cache headers the same file may be downloaded twice — once to decode the poster frame and once again for playback.
If your task could benefit from participants citing specific frame numbers, you can turn on frame controls by supplying a frame_rate attribute for each video. See Frame controls for video fields for details.
Frame controls for video fields
To let participants refer to a specific frame in a video, give each video its frame rate in your dataset. A video with a frame rate gets a frame counter and frame-step buttons in the participant’s video player.
There is no layout setting for frame controls, and no default frame rate. A video with a frame rate gets frame controls automatically. A video without one gets the standard player with no counter. Prolific never guesses a frame rate, because a wrong one records wrong frame numbers.
The frame rate belongs to each video file, so it goes in your data rather than in the task layout, and different rows can hold videos at different rates.
- Add a column for the rate and declare it in the schema as a
metadatafield. You can name it anything. - On the
video_urlfield, bind theframe_rateattribute to that column withattributes.
Each row then supplies its own rate, for example { "prompt": "…", "video_a": "https://…/clip.mp4", "video_a_fps": 25 }.
frame_rateis the attribute name Prolific defines. The column name is yours.- The rate is a number from 1 to 480 (frames per second). Fractional rates such as
29.97are allowed, and a numeric string is accepted. - A row with an invalid rate is rejected at import, and the error names the rate column. A missing or blank rate is not an error: that video simply has no frame controls. In a strict schema the column must still be present.
- The rate column is
metadata, so participants do not see it. Several video fields can share one column. attributesis only allowed for supported attributes on the field types that support them, and each column must be a declaredmetadatafield in the same schema. Anything else is rejected with400.- Frames are numbered from 1.
- To add, change or remove a binding on a dataset that already has data, update the schema: existing rows are reprocessed from the original upload, so the column must have been in that upload. Uploading the same file again does not apply the change.
Strict mode
The strict flag controls how missing fields are handled during import.
Schema constraints
- Maximum 200 fields per schema.
- Field keys: 1–128 characters.
- Field labels: maximum 255 characters.
- At most one field of type
task_group_idper schema.
Referencing schema fields in the batch layout
Once a dataset with a schema is attached to a batch, you can use dataset_field items in batch_items to display dataset values to participants.
Only fields of type text, image_url, audio_url, or video_url can be referenced by dataset_field items. metadata and task_group_id fields are not displayed to participants.
Frame controls on a video are not set in the layout. A video_url field shows them whenever the dataset supplies a frame rate for that video. See Frame controls for video fields.
Retrieving a dataset with its schema
The response includes the current schema and all import jobs: