{% extends 'base.html' %} {% block title %}API - MetaBrainz Foundation{% endblock %} {% block content %}

{{ _('MetaBrainz API') }}

{{ _('All endpoints require an access token which you can get from your profile page.', profile_url=url_for('supporters.profile')) }}

{{ _('MusicBrainz Live Data Feed') }}

{{ _('There are two endpoints for fetching live data:') }}

{{ _('Hourly Replication Packets') }}

GET {{ url_for('api_musicbrainz.replication_hourly', _external=True, _scheme=config.PREFERRED_URL_SCHEME, packet_number=42, token="TOKEN") | replace("42", "") | replace("TOKEN", "") }}

{{ _('It is possible to get a signature for each replication packet. Just replace .tar.bz2 with .tar.bz2.asc.') }}

{{ _('You can find the latest replication packet number from this endpoint:') }}
GET {{ url_for('api_musicbrainz.replication_info', _external=True, _scheme=config.PREFERRED_URL_SCHEME, token="TOKEN") | replace("TOKEN", "") }}

{{ _('Hourly Incremental JSON Dumps') }}

GET {{ url_for('api_musicbrainz.json_dump', _external=True, _scheme=config.PREFERRED_URL_SCHEME, packet_number=42, entity_name="ENTITY_NAME", token="TOKEN") | replace("42", "") | replace("ENTITY_NAME", "") | replace("TOKEN", "") }}

{{ _('The JSON dumps are partitioned by entity type. <ENTITY_NAME> can be one of: area, artist, event, instrument, label, place, recording, release, release-group, series, or work.') }}

{{ _('It’s possible that a JSON dump for a particular entity type doesn’t exist if no entities of that type have changed in a given hour.') }}

{{ _('Each dump contains a file named mbdump/<ENTITY_NAME>. This file must be read line-by-line; each line contains one changed entity in JSON format.') }}

{{ _('As with replication packets, you can obtain a file signature by replacing .tar.xz with .tar.xz.asc.') }}

{% endblock %}