- Input schema defines the fields a collection run accepts, such as
url,keyword,country,date, or any custom field your interaction code reads frominput. - Output schema defines the structured fields the scraper returns, based on the data emitted by
collect().
What is the input schema?
The input schema defines the values your scraper can receive at runtime. A scraper often uses aurl input, but inputs are not limited to URLs. Depending on the collector logic, inputs can be keywords, locations, dates, IDs, countries, or any custom parameter.
Your interaction code reads input values through the input object:
Define input parameters
To define the input schema in the Bright Data Scraper Studio IDE:- Open your collector in the Scraper Studio IDE.
- Go to the Code tab.
- Click Add input parameter.
- Enter a field name, for example
url,keyword,country, ordate. - Add an optional description.
- Select the field type.
- Mark the field as Required if the collector cannot run without it.
- Click Save.
- Click Save to Production when the collector is ready.
What are the input parameter settings?
What do collection inputs look like?
A URL-based collector can accept one or more URLs:What is the output schema?
The output schema defines the data point structure and how the data is organized. In the Bright Data Scraper Studio IDE, the output schema is usually generated from the object passed tocollect().
Update the output schema
There are two ways to update the output schema: automatically from parser code or manually in the schema editor.Update the schema automatically
- Add or change fields in your parser code.
- Run a preview to confirm that required fields return as expected.
- Click Save to Production.
- If Scraper Studio detects schema changes, click Update schema.
- Click Save to Production again.
Update the schema manually
- Click Edit schema in the IDE.
- Add or edit fields by name and type.
- Configure required flags, default values, formatting, validation, or PII settings.
- Save the schema.
- Click Save to Production.
What is the Output Schema Editor?
The Output Schema Editor defines exactly which fields your collector returns and how each field is validated, formatted and delivered. The editor has two views:
Clicking a field row opens the configuration side panel for that field.
How is an output schema structured?
An output schema is a JSON object with a top-leveltype and a fields object:
What properties can output fields have?
These properties apply to user-defined output fields.Configure a field in the side panel
The side panel contains field-specific settings.What default values are available?
Available default values depend on the field type.What output field types are available?
Scraper Studio supports the following user-defined output field types.text
Free-form text.
number
Integer or decimal number. Numeric strings can be converted to numbers.
url
A URL string. Only http:// and https:// URLs are accepted.
price
A monetary value represented as a numeric value and currency code.
boolean
A true/false value.
date
Date or timestamp value.
Locale formatting can include:
- Locale, for example
en-US,fr-FR,ru-RU - Date style:
long,medium,short - Time style:
long,medium,short
country
A two-letter ISO 3166-1 alpha-2 country code.
phone
A phone number parsed into structured components.
image
A downloaded or referenced image.
video, pdf and doc
These file types use the same download and behavior settings as image.
File field output options
For downloaded file fields, such asimage, video, pdf, and doc, the output schema editor lets you control how file metadata is returned.
These settings appear when the field behavior is set to Object.
Behavior
Use Behavior to choose how the file field is returned.- Simple: returns only the downloaded file path or the original remote URL.
- Object: returns an object with file metadata, such as
file_path,remote_url,content_type,file_size, andresponse_headers, depending on which options are enabled.
Include content type
Enable Include content type to include the file MIME type in the output. Example:Include file size
Enable Include file size to include the downloaded file size in bytes. Example:Include response headers
Enable Include response headers to include the HTTP response headers received when Scraper Studio downloads the file. Example:Example output
When Behavior is set to Object and all metadata options are enabled, the output can look like this:array
An ordered list of values. The element type is defined with items.
Array of nested objects:
object
A nested object with its own subfields.
What HTML conversion field types are available?
Example:
How do I validate field values?
Custom validation lets you define JavaScript rules that run on every collected value for a field. Throw an error to mark the value as invalid:How do I format field values?
Custom formatting lets you transform a field value before output delivery.When do I use collect() vs set_lines()?
The way records are emitted affects the output dataset.
Example with
collect():
set_lines():
What system fields can I add?
System fields are generated by Scraper Studio. Their names and types are fixed. You can toggle them on or off in the output schema configuration under Additional data.
When
screenshot, html, or warc are active, the files are downloaded to the configured storage destination.
How do I add a screenshot watermark?
When thescreenshot system field is enabled, a watermark can be added to the screenshot. Each watermark item has a label and a data source.
What does a full output schema look like?
Related
Develop a scraper
Step-by-step walkthrough of building a scraper in the IDE
Functions reference
Interaction and parser functions with parameters and examples
Initiate collection and delivery
Trigger collection and deliver output to your destination
Trigger a scraper (API)
Run a published collector for batch collection by API