Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get results for client.get_assets_by_id('PSScene3Band', <scene_id>) #1

Closed
modulitos opened this issue May 23, 2017 · 6 comments
Assignees

Comments

@modulitos
Copy link

First, thank you for the amazing talk at PyCon :-D

I signed up for a Planet api key by creating an account here: https://www.planet.com/account/ and I am following your demo, but I am blocked when we make a call to client.get_assets_by_id('PSScene3Band', <scene_id>) (in the call to get_products on In [31] of your TheBasics.ipynb notebook).

client.get_assets_by_id returns an empty object. It appears to make an HTTP GET to https://api.planet.com/data/v1/item-types/PSScene3Band/items/<scene_id>/assets/, so I explored that endpoint a bit, and it seems to be an access issue.

For example, here is my call (api_key omitted for security): https://api.planet.com/data/v1/item-types/PSScene3Band/items/20170520_181725_1044/assets/?api_key=<api_key> but here is my response:

{"message": "Please enter your API key.", "errors": []}

Any suggestions about how to get a response here would be great.

@sahil210695
Copy link

Same error here also !!! Solution please !!!

@modulitos
Copy link
Author

modulitos commented May 23, 2017

FWIW, I'm getting a response when I hit this endpoint: https://api.planet.com/data/v1/item-types/PSScene3Band/items/20170520_181725_1044, but when I query for the assets of that item (by appending /assets to the url), I'm getting an empty object. Why don't these items have any assets?

If it helps, here is the code for the client.get_assets_by_id method:

    def get_assets_by_id(self, item_type, id):
        '''Get an item's asset response for the given item_type and id

        :param item_type str: A valid item-type
        :param id str: The id of the item
        :returns: :py:Class:`planet.api.models.JSON`
        :raises planet.api.exceptions.APIException: On API error.
        '''
        url = 'data/v1/item-types/%s/items/%s/assets' % (item_type, id)
        return self._get(url).get_body()

@kscottz
Copy link
Owner

kscottz commented May 24, 2017

Sorry about the delay. I've been traveling. Let me pull in some support people.

@kscottz
Copy link
Owner

kscottz commented May 24, 2017

I notified Planet's developer advocate and the public API manager. They will take a look shortly.

@kscottz
Copy link
Owner

kscottz commented May 24, 2017

Also I would file a ticket over here where the client is being maintained. You might get a faster response.

@danabauer danabauer self-assigned this May 24, 2017
@danabauer
Copy link
Collaborator

@Lukeswart This is likely a permissions issue. You're looking at imagery of the Seattle area that was captured just a few days ago. When you sign up for a free Planet account, you get download access to our archive of California data (with a two-week delay) under a CC BY-SA 4.0 license. We do have a program to give academic researchers free access to other geographic areas. But Open California is your best bet if you're a dev or data analyst wanting to get started with the full range of Planet's imagery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants