Sunday, August 5, 2018

[Code snippet]: Planet API Image Download Url


from requests.auth import HTTPBasicAuth
import os
import requests


item_id = "20161109_173041_0e0e"
item_type = "PSScene3Band"


os.environ['PLANET_API_KEY'] = '3b711bededf6485a0' #not a real id
asset_type = "visual"
item_url = 'https://api.planet.com/data/v1/item-types/{}/items/{}/assets'.format(item_type, item_id)

# Request a new download URL
result = requests.get(item_url, auth=HTTPBasicAuth(os.environ['PLANET_API_KEY'], ''))
download_url = result.json()[asset_type]['location']

print(download_url)

Planet API , Python

1 comment :

  1. The story you have shared in your post are really awesome and I must say you have done a great job. I like your post and appreciate your work. Thanks for sharing. net worth

    ReplyDelete

 

© 2011 GIS and Remote Sensing Tools, Tips and more .. ToS | Privacy Policy | Sitemap

About Me