Created
November 23, 2018 05:43
-
-
Save parulnith/1025d704f474f14e1ea6da7cc256884a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import requests | |
from requests.auth import HTTPBasicAuth | |
# API Key stored as an env variable | |
PLANET_API_KEY = os.getenv('PL_API_KEY') # replace PL_API_KEY with Planet API key in quotes | |
item_type = "PSScene4Band" | |
# API request object | |
search_request = { | |
"interval": "day", | |
"item_types": [item_type], | |
"filter": combined_filter | |
} | |
# fire off the POST request | |
search_result = \ | |
requests.post( | |
'https://api.planet.com/data/v1/quick-search', | |
auth=HTTPBasicAuth(PLANET_API_KEY, ''), | |
json=search_request) | |
print(json.dumps(search_result.json(), indent=1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment