UPDATE: the issue described below has now been fixed and the correct list of downloadable files will be reflected in both permissions and the assets list.
The Planet Data API is a little misleading in reporting the presence of analytic
assets when they don't actually exist for a particular item. However, the _permissions
field does report whether you will be able to download an analytic
if you try.
As an example, see https://api.planet.com/data/v1/item-types/PSScene3Band/items/20161015_204122_0c0b.
The permissions are:
[
"assets.basic_analytic_dn:download",
"assets.analytic_dn:download",
"assets.basic_udm:download",
"assets.visual:download",
"assets.analytic_dn_xml:download",
"assets.basic_analytic_dn_xml:download",
"assets.basic_analytic_dn_rpc:download",
"assets.visual_xml:download",
"assets.udm:download"
]
This correctly informs you that there is no analytic
asset that can be downloaded. Likewise, although there is an analytic
entry in the response to https://api.planet.com/data/v1/item-types/PSScene3Band/items/20161015_204122_0c0b/assets/, the permissions list there also indicates that you can't download it:
"analytic": {
"_links": {
"_self": "https://api.planet.com/data/v1/assets/eyJpIjogIjIwMTYxMDE1XzIwNDEyMl8wYzBiIiwgImMiOiAiUFNTY2VuZTNCYW5kIiwgInQiOiAiYW5hbHl0aWMiLCAiY3QiOiAiaXRlbS10eXBlIn0",
"activate": "https://api.planet.com/data/v1/assets/eyJpIjogIjIwMTYxMDE1XzIwNDEyMl8wYzBiIiwgImMiOiAiUFNTY2VuZTNCYW5kIiwgInQiOiAiYW5hbHl0aWMiLCAiY3QiOiAiaXRlbS10eXBlIn0/activate",
"type": "https://api.planet.com/data/v1/asset-types/analytic"
},
"_permissions": [],
"status": "inactive",
"type": "analytic"
}
For assets that can be downloaded, "_permissions"
will be set to [download]
.
An update to the API will make this clearer, by removing the entry for analytic
altogether when it is not available for download.
One other clarifying point, the analytic_dn
asset in the Data API is equivalent to the analytic
from API v0. The analytic
asset in the Data API is a new product (specs in documentation).