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 = '{}/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']


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



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

About Me