Coder Social home page Coder Social logo

Export data to GEE failed about notebooks HOT 4 CLOSED

CarlBethuel avatar CarlBethuel commented on September 23, 2024
Export data to GEE failed

from notebooks.

Comments (4)

sarasafavi avatar sarasafavi commented on September 23, 2024 1

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.

sarasafavi avatar sarasafavi commented on September 23, 2024 1

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.

CarlBethuel avatar CarlBethuel commented on September 23, 2024

@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.

CarlBethuel avatar CarlBethuel commented on September 23, 2024

@sarasafavi Great, I'll check that ! Thanks a lot !

from notebooks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.