Archive Search
In this guide, we’ll walk you through how to use our Search All Items endpoint to query archived imagery. This endpoint lets you filter and retrieve STAC items based on various criteria, helping you find the exact imagery you need. We’ll break down the JSON request into steps, explain each parameter, and provide sample snippets for clarity.
Overview
The Search All Items endpoint allows you to perform a flexible search across all archived imagery. You can filter results by date ranges, spatial extents, and metadata such as cloud cover or platform type. This is particularly useful when you need to narrow down a large archive to a set of relevant items.
- Endpoint:
POST /v0/archives/search
- Method: POST
- Content-Type:
application/json
- Authentication: Include your API key in the header as:
Step-by-Step Breakdown of the Search Request
1. Define the Date Range
Specify the time period during which the imagery was captured.
- Field:
datetime
- Format: ISO8601 date range, e.g.,
"2018-02-12T00:00:00Z/2018-03-18T12:31:12Z"
Snippet:
2. Select the Collection
Filter your search to a specific collection by its ID.
This is useful if you know you want to query items from a particular dataset/collection you are interested in(e.g., pixxel-td-l2a
).
- Field:
collections
- Format: An array of collection IDs.
Snippet
3. Set Spatial Filters
There are two ways to define the spatial extent of your search:
a. Using GeoJSON (intersects
)
Limit the search to imagery that intersects with a specified Area of Interest (AOI).
- Field:
intersects
- Format: A GeoJSON geometry (typically a Polygon)
Snippet:
b. Using a Bounding Box (bbox
)
Alternatively, you can define a bounding box to constrain the spatial search.
- Field:
bbox
- Format: An array of four numbers:
[minLongitude, minLatitude, maxLongitude, maxLatitude]
Snippet
Note: You can use either
intersects
orbbox
based on your preference. They serve similar purposes but offer different levels of precision.
4. Apply Additional Attribute Filters
Narrow down the results based on specific metadata, such as cloud cover or platform.
- Field:
query
- Format: JSON object containing field-specific filters.
- Example Filters:
cloud_cover
: Items with cloud cover less than a certain percentage.platform
: Items captured by a specific satellite.
Snippet:
5. Sorting the Results
Order the search results based on one or more fields (e.g., datetime, cloud_cover).
- Field:
sortby
- Format: An array of sort objects. Each sort object should have:
field
: The field to sort by.direction
: Either"asc"
(ascending) or"desc"
(descending).
Snippet
6. Control Pagination
Manage the number of results returned and navigate through large result sets.
- Fields:
limit
: Maximum number of items to return (e.g., 10).offset
: Number of items to skip (e.g., 0 for the first page).
Snippet:
Putting It All Together
Below is the complete JSON request for searching archived imagery using the “Search All Items” endpoint. Customize the values as needed for your search criteria.
How to Use the Endpoint
- Construct Your Request:
Use the snippets above to build a JSON request tailored to your search needs. - Send the Request:
Make a POST request tohttps://api.pixxel.space/v0/archives/search
with the JSON body. - Examine the Response:
The API will return a FeatureCollection containing matching STAC Items, along with pagination details.