Skip to content

API Data Types and Their Significance

harnick edited this page Jan 31, 2023 · 1 revision

Preface

This page is a list of API data, separated by their Endpoints, with their data types (where discernable), and what they signify.

Most are self-explainable, but the uses of one variable can be mistaken for another available. I know I did for some.

Endpoint Data

Summary Endpoint

The returned data contains a fan_id variable identical to that contained in collection_summary. For simplicity's sake, it's been ommitted.

collection_summary

Name Type Usage Example Notes
fan_id Long An account's identification number 7172620
username String The account username and URL location to view the account's collection "harnick" Not to be confused with the account name, which isn't supplied in any data, and is only displayed on your collection page.
url String As mentioned in username - "https://bandcamp.com/$username" "https://bandcamp.com/harnick"
tralbum_lookup Map<String, TrLookupItem> A Map of your purchased albums Key is item_id prefixed by item_type.
follows Empty JSON Object Supposedly represents your following list? Also contains an empty object for your following list.
These are always null. No idea why.

TrLookupItem

Name Type Usage Example Notes
item_type String "a"
item_id Long 2582134259
band_id Long 2935847002
purchased String The purchase date and time in "dd MMM yyyy HH:mm:ss zzz" format "25 Aug 2022 20:23:04 GMT" Unsure if timezone is always GMT, or relative to purchaser

Item Endpoint

collection_items

Name Type Usage Example Notes
collectors Empty Object
item_lookup Map<Long, CollectionLookupItem>
items List A list of all your collection items.
last_token String
more_available Boolean True if count in request is lower than the number of items in your collection.
purchase_infos Empty Object
redownload_urls Map<String, String> Map values direct you to package's download page. Key is item_id prefixed with "p".
tracklists Map<String, List<Track>> Key is item_id prefixed by item_type.

CollectionLookupItem

Name Type Usage Example Notes
item_type String "a"
purchased Boolean

Track

Name Type Usage Example Notes
artist String
duration Double Duration of track in seconds.
file Map<String, String> Value is a direct url to stream the track.
id Long
title String
track_number Int? Index of track in album. Null if package type is Track.