Solved

How to request the list of available mosaics from the Python API V2

  • 3 April 2023
  • 1 reply
  • 102 views

Badge +2

Hi,
I was previously using the version 1, waiting for the release of the v2 but the numerous bugs that are rising from 1.4.9 forced me to wire on the more recent release candidates.

 

Prior, using an authenticated client, I was able to request the list of mosaics using the following:

import os
import planet

client = planet.api.ClientV1(api_key=os.environ["PL_API_KEY"])

mosaics = client.list_mosaics().get()
print(mosaics)

 

Is it still possible in V2 ? I searched for a list_mosaics or get_mosaics method but I found nothing.

icon

Best answer by pierrick rambaud 3 April 2023, 14:37

View original

1 reply

Badge +2

okay after some small digging it seems basemaps are not directly wired in the V2 but still reachable using a simple request as such:

 

import requests

BASE_URL = 'https://api.planet.com/basemaps/v1/mosaics?api_key={}'
res = requests.get(BASE_URL.format(API_KEY))

res.json()["mosaics"]

 

Reply