Development/Seeding
Forms for creating new MusicBrainz entities can be “seeded” with values supplied via POST-ed multipart/form-data
body parameters (for the Add Release page) or URL query parameters (for most other pages). Third-party tools that use seeding to make it easier to import data into MusicBrainz are listed at External Resources.
Add Release
You can seed a new release with a POST request. See the release editor seeding documentation for details.
Other pages (Add Artist, Add Label, Add Standalone Recording, etc.)
Most non-release forms can be seeded via URL query parameters sent via GET requests.
In almost all cases, a form input can be seeded by passing a parameter corresponding to input's name
attribute. For example, the Add Artist page's “Name” field is defined in the page source as <input ... name="edit-artist.name" ...>
, and a URL like https://musicbrainz.org/artist/create?edit-artist.name=My+Name will initialize the field to the text “My Name”.
To set a checkbox input, pass the value 1
.
The following pages support seeding:
Add Artist
Inputs are seeded as described above, with the following notes:
- Type (
edit-artist.type_id
) corresponds to theartist_type
table'sid
column. - Gender (
edit-artist.gender_id
) corresponds to thegender
table'sid
column. - Area (
edit-artist.area.name
) contains text used to fill the field for searching. - IPI codes (
edit-artist.ipi_codes.0
,.1
, etc.) can be set using multiple parameters. - ISNI codes (
edit-artist.isni_codes.0
,.1
, etc.) can be set using multiple parameters. - Began (
edit-artist.period.begin_date.year
,.month
,.day
) accepts integer values for each parameter. - Ended (
edit-artist.period.end_date.year
,.month
,.day
) is similar to Began. - Relationships are seeded using multiple parameters prefixed with
rels.0.
rather than the usualedit-artist.
prefix. Multiple relationships can be seeded using prefixes likerels.1.
.rels.0.target
contains the target entity's MBID or name (for searching).rels.0.type
contains a value from thelink_type
table'sid
column.rels.0.source_credit
andrels.0.target_credit
contain alternate “credited as” strings for the source and target entities.rels.0.begin_date
andrels.0.end_date
accept a date asYYYY-MM-DD
,YYYY-MM
, orYYYY
.rels.0.ended
is1
if the relationship has ended.rels.0.backward
is1
if the relationship's direction should be reversed.- Relationship attributes are seeded using parameters prefixed with
rels.0.attributes.0.
:rels.0.attributes.0.type
contains a value from thelink_attribute_type
table'sid
column.rels.0.attributes.0.credited_as
contains a string for the “credited as” field, e.g. describing how an instrument was credited.rels.0.attributes.0.text_value
holds additional text associated with some attribute types, e.g. the actual number when setting the “number” attribute on a recording-series part-of relationship.
- External Links (
edit-artist.url.0.text
,.0.link_type_id
, etc.) accepts paired URL strings and values from thelink_type
table'sid
column.