Bandcamp API

Sales API

The Bandcamp Sales Report API gives you access to your sales report delivered in either a CSV or JSON format via standard web development techniques. This report is also available through the Tools page on your band or label account.

All API calls should be POSTs with the Authorization header set to:

Authorization: Bearer {your access token}

The unique ids for all your affiliated artists and labels can be found using the my_bands call to the Account API.

sales_report

version

URL

https://bandcamp.com/api/sales/2/sales_report

What’s changed in version 2?

  • The tax column has been split into seller tax and marketplace tax. More info here.
Parameters
band_id
the unique id of the band or label you are calling as or on behalf of
member_band_id
(optional) the unique id of a band you wish to filter your results on, if you're calling as or on behalf of a label (you don't need this if you are calling on behalf of a band, just use that band's id in the band_id field)
start_time
the earliest UTC sale time an item could have and still be included in the results, i.e. start_time <= sale_item
end_time
(optional) the earliest UTC sale time (after start_time) an item could have and be excluded in the results, i.e. sale_item < end_time (default is the time of the call)
format
(optional) the format you wish to receive results in - either 'csv' or 'json' (default is 'json')

Example

JSON

Request

{
    "band_id": 1633770804,
    "member_band_id": 1925197437,
    "start_time": "2021-01-01 00:00:00",
    "end_time": "2021-02-01 00:00:00",
    "format": "json"
}

Response

Note: the fields here are ordered for the purposes of documentation, the actual response is an unordered JSON object.
{
    "142901548": {
        "date": "04 Jan 2021 23:22:11 GMT",
        "paid_to": "Bandcamp",
        "item_type": "album",
        "item_name": "Very Cool Band Greatest Hits",
        "artist": "Very Cool Band",
        "currency": "USD",
        "item_price": 9.99,
        "quantity": 1,
        "discount_code": null,
        "sub_total": 9.99,
        "seller_tax": null,
        "marketplace_tax": null,
        "shipping": null,
        "ship_from_country_name": null,
        "transaction_fee": 0.49,
        "fee_type": "paypal",
        "item_total": 9.99,
        "amount_you_received": 9.5,
        "bandcamp_transaction_id": 2095918850,
        "paypal_transaction_id": null,
        "net_amount": 8.5,
        "package": "digital download",
        "option": null,
        "item_url": "https://verycoolband.bandcamp.com/album/very-cool-band-greatest-hits",
        "catalog_number": null,
        "upc": "",
        "isrc": "",
        "buyer_name": "Chris Jones",
        "buyer_email": "cjones@email.com",
        "buyer_phone": null,
        "buyer_note": null,
        "ship_to_name": "",
        "ship_to_street": "",
        "ship_to_street_2": "",
        "ship_to_city": null,
        "ship_to_state": null,
        "ship_to_zip": null,
        "ship_to_country": null,
        "ship_to_country_code": null,
        "ship_date": null,
        "ship_notes": null,
        "country": "United States",
        "country_code": "US",
        "region_or_state": "IL",
        "city": "Townsville",
        "referer": "Bandcamp search",
        "referer_url": "bandcamp.com/app/android/search",
        "sku": null
        },
    ...
}

CSV

Request

{
    "band_id": 1633770804,
    "member_band_id": 1925197437,
    "start_time": "2021-01-01 00:00:00",
    "end_time": "2021-02-01 00:00:00",
    "format": "csv"
}

Response

Note: the CSV fields here match the order of the fields in the JSON section.
{
    "csv": "Mon Jan 04 23:22:11 UTC 2021,Bandcamp,album,Very Cool Band Greatest Hits,Very Cool Band,USD,9.99,1,,9.99,,,,,0.49,paypal,9.99,9.5,2095918850,,8.5,digital download,,https://verycoolband.bandcamp.com/album/very-cool-band-greatest-hits,,,,Chris Jones,cjones@email.com,,,,,,,,,,,,United States,US,IL,Townsville,Bandcamp search,bandcamp.com/app/android/search,|
    ..."
}

URL

https://bandcamp.com/api/sales/1/sales_report
Parameters
band_id
the unique id of the band or label you are calling as or on behalf of
member_band_id
(optional) the unique id of a band you wish to filter your results on, if you're calling as or on behalf of a label (you don't need this if you are calling on behalf of a band, just use that band's id in the band_id field)
start_time
the earliest UTC sale time an item could have and still be included in the results, i.e. start_time <= sale_item
end_time
(optional) the earliest UTC sale time (after start_time) an item could have and be excluded in the results, i.e. sale_item < end_time (default is the time of the call)
format
(optional) the format you wish to receive results in - either 'csv' or 'json' (default is 'json')

Example

JSON

Request

{
    "band_id": 1633770804,
    "member_band_id": 1925197437,
    "start_time": "2016-01-01 00:00:00",
    "end_time": "2016-02-01 00:00:00",
    "format": "json"
}

Response

Note: the fields here are ordered for the purposes of documentation, the actual response is an unordered JSON object.
{
    "142901548": {
        "date": "04 Jan 2016 23:22:11 GMT",
        "paid_to": "Bandcamp",
        "item_type": "album",
        "item_name": "Very Cool Band Greatest Hits",
        "artist": "Very Cool Band",
        "currency": "USD",
        "item_price": 9.99,
        "quantity": 1,
        "discount_code": null,
        "sub_total": 9.99,
        "tax": null,
        "shipping": null,
        "ship_from_country_name": null,
        "transaction_fee": 0.49,
        "fee_type": "paypal",
        "item_total": 9.99,
        "amount_you_received": 9.5,
        "bandcamp_transaction_id": 2095918850,
        "paypal_transaction_id": null,
        "net_amount": 8.5,
        "package": "digital download",
        "option": null,
        "item_url": "https://verycoolband.bandcamp.com/album/very-cool-band-greatest-hits",
        "catalog_number": null,
        "upc": "",
        "isrc": "",
        "buyer_name": "Chris Jones",
        "buyer_email": "cjones@email.com",
        "buyer_phone": null,
        "buyer_note": null,
        "ship_to_name": "",
        "ship_to_street": "",
        "ship_to_street_2": "",
        "ship_to_city": null,
        "ship_to_state": null,
        "ship_to_zip": null,
        "ship_to_country": null,
        "ship_to_country_code": null,
        "ship_date": null,
        "ship_notes": null,
        "country": "United States",
        "country_code": "US",
        "region_or_state": "IL",
        "city": "Townsville",
        "referer": "Bandcamp search",
        "referer_url": "bandcamp.com/app/android/search",
        "sku": null
        },
    ...
}

CSV

Request

{
    "band_id": 1633770804,
    "member_band_id": 1925197437,
    "start_time": "2016-01-01 00:00:00",
    "end_time": "2016-02-01 00:00:00",
    "format": "csv"
}

Response

Note: the CSV fields here match the order of the fields in the JSON section.
{
    "csv": "Mon Jan 04 23:22:11 UTC 2016,Bandcamp,album,Very Cool Band Greatest Hits,Very Cool Band,USD,9.99,1,,9.99,,,,0.49,paypal,9.99,9.5,2095918850,,8.5,digital download,,https://verycoolband.bandcamp.com/album/very-cool-band-greatest-hits,,,,Chris Jones,cjones@email.com,,,,,,,,,,,,United States,US,IL,Townsville,Bandcamp search,bandcamp.com/app/android/search,|
    ..."
}

generate_sales_report

Triggers generation of a sales report. Returns a token used to retrieve the generated report later.

URL

https://bandcamp.com/api/sales/2/generate_sales_report
Parameters
band_id
the unique id of the band or label you are calling as or on behalf of
member_band_id
(optional) the unique id of a band you wish to filter your results on, if you're calling as or on behalf of a label (you don't need this if you are calling on behalf of a band, just use that band's id in the band_id field)
start_time
the earliest UTC sale time an item could have and still be included in the results, i.e. start_time <= sale_item
end_time
(optional) the earliest UTC sale time (after start_time) an item could have and be excluded in the results, i.e. sale_item < end_time (default is the time of the call)
format
(optional) the format you wish to generate a report in - either 'csv' or 'json' (default is 'json')

Example

Request

{
    "band_id": 1633770804,
    "member_band_id": 1925197437,
    "start_time": "2021-01-01 00:00:00",
    "end_time": "2021-02-01 00:00:00",
    "format": "json"
}

Response

{
    "token": "1633770804-c3e3910398c0009a2e43a01b286c9a60"
}

fetch_sales_report

Returns a URL to download the sales report for a given token.

URL

https://bandcamp.com/api/sales/2/fetch_sales_report
Parameters
token
the unique token returned from the generate_sales_report request

Example

Request

{
    "token": "1633770804-c3e3910398c0009a2e43a01b286c9a60"
}

Response

{
    "url": "https://bandcamp.com/file?id=93001130&name=1633770804-c3e3910398c0009a2e43a01b286c9a60&sig=yLkNPB4CEYOUKNuI5BttJ00KQo8%3D"
}