Comments (4)
Hi @CarlBethuel --
os.environ['PL_API_KEY']='API_KEY' #I put my email address here
PLANET_API_KEY = os.getenv('PL_API_KEY')
Couple points of confusion here: first, you should use your API key, not your email address. To find your API key, see: https://developers.planet.com/quickstart/apis/#find-your-api-key
Second, the goal here is to set PLANET_API_KEY
to your API key... you can either add it as an environment variable, or modify the second line in this section accordingly.
auth = HTTPBasicAuth(PLANET_API_KEY, 'Password')#I put my password here
You shouldn't put your password in here at all; leave this line as-is (Password
is an argument passed to HTTPBasicAuth()
).
from notebooks.
Great, a 401 means your code is working!
To learn more about what data your Planet account can access, you should get in touch with your Customer Support representative. If you don't already know who that is, reach out to Planet's support team via https://support.planet.com/hc/en-us/requests/new/
from notebooks.
@sarasafavi First of all, thank you for your answer.
I made the changes you indicated and I get :
import json
import os
import pathlib
import time
import requests
from requests.auth import HTTPBasicAuth
PLANET_API_KEY = os.getenv('MY_API_KEY')
orders_url = 'https://api.planet.com/compute/ops/orders/v2'
auth = HTTPBasicAuth(PLANET_API_KEY, '')
response = requests.get(orders_url, auth=auth)
response
When I run this I get : <Response [401]>
After that I can't run the script. On the planet website, the 401 error is "Access denied". How can I get the authorization to get data ?
from notebooks.
@sarasafavi Great, I'll check that ! Thanks a lot !
from notebooks.
Related Issues (20)
- analysis-ready-data notebook "ard_2_use_case_1.ipynb" file has async issues leading to errors
- ard_1_intro_and_best_practices.ipynb CLI -> SDK
- ard_1_intro_and_best_practices.ipynb make plots more readable
- ard_2_use_case_1_visualize_images.ipynb
- Fix README for analysis ready data notebook
- analytics notebook case study syria
- analytics/quickstart/01_checking_available_feeds_and_subscriptions.ipynb errors and docs
- analytics/quickstart/02_fetching_feed_results.ipynb formatting & docs
- analytics/quickstart/03_visualizing_raster_results.ipynb
- analytics/user-guide/01_getting_started_with_the_planet_analytics_api.ipynb
- analytics/user-guide 02
- analytics-snippets/raster_to_vector_roads HOT 2
- analytics-snippets/raster_to_vector_buildingfootprints
- cloud-native-geospacial/intro-to-stac/introduction-to-stac-part2.ipynb
- cloud-native-geospacial/intro-to-stac/introduction-to-stac-part1.ipynb
- analytics/Change_detection_heatmap
- analytics/user-guide 2-5 need data fixes
- Request for Assistance with Downloading PlanetScope Imagery HOT 1
- Problem to open jupyter using Docker Method HOT 1
- Notebook does not recognize API Key HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notebooks.