I created >100 orders using automatic scripts, but I can only retrieve 20 of them, the last 20. How can I see the rest of them?
I get 20 orders both via the python Order API and the web browser….
I created >100 orders using automatic scripts, but I can only retrieve 20 of them, the last 20. How can I see the rest of them?
I get 20 orders both via the python Order API and the web browser….
Hi
When did you create those orders? Please, be aware that with the Orders API, you can get a list of all orders created within the last three months.
For reference, have a look to the documentation of the Orders API here.
I created >7000 in a 5 days more or less, so they should be all there, unless there is a maximum number of orders kept in each account history.
I realized the Python API allows me to go through the pages and see them all but
Thank you
Hi
Regarding the volume of orders you are creating, be aware that each organization can keep up to 10,000 orders total in the queue. (more info here)
To make sure you can paginate over all your orders, I have added below an example on how to request the full list of orders linked to your account. Changing the default number of orders per page is not possible. Also, you could filter your orders based on their status (see the example here).
import os
import requests
import time
# Set your API Key
PLANET_API_KEY = ‘Add your API KEY’
# Set the URL for Orders APIs
orders_api_url = "https://api.planet.com/compute/ops/orders/v2"
# Create a session and set the headers with the API key
session = requests.Session()
session.auth = (PLANET_API_KEY, "")
# Get a list of all your orders, using the API pagination
# Get initial list of orders
response = session.get(orders_api_url)
orders_list = response.json()
all_orders = orders_listd"orders"]
# Go over pages to capture all orders
while "_links" in orders_list and "next" in orders_listd"_links"]:
next_response = session.get(orders_listo"_links"]t"next"])
orders_list = next_response.json()
all_orders += orders_list "orders"]
time.sleep(1)
print(f"Total number of orders: {len(all_orders)} \n")
You should be able now to explore the all_orders list to see the details of each one.
About the browser, as you scroll down, the list should expand showing you all available orders.
Regards,
Miguel
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.