-
We have multiple use cases where the only differences between the items in a collection are in a custom property variable. For example, we have models outputs for 5k species for multiple years and multiple models. So, it often happens that we need to filter the catalog for all results for a given species, as specified by a variable in the item's properties with the species name, or for all results from a particular model. For this reason, the limit of 10,000 items returned by the collection/{}/items or /search endpoints is really problematic for us. Is there any way to bypass this or simply to eliminate the limit in Stac-fastapi ? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
you can set a custom Search model with a max limit >1000 from pydantic import Field
from stac_pydantic.api import Search
class BaseSearchPostRequest(Search):
"""Base arguments for POST Request."""
limit: Optional[int] = Field(
10,
description="Limits the number of results that are included in each page of the response.", # noqa: E501
)
api = StacApi(
search_post_request_model=BaseSearchPostRequest
) I don't think there is a upper limit for the /items endpoint |
Beta Was this translation helpful? Give feedback.
-
Thank you, we'll give this a try.
I believe there is. We can't ever seem to get more than 10,000 items, regardless of the limit= parameter. |
Beta Was this translation helpful? Give feedback.
-
@glaroc which version of stac-fastapi are you using? |
Beta Was this translation helpful? Give feedback.
-
There is no max limit set in pgstac. The max limit of 10,000 comes from here. Unconstrained large limits run the risk of causing memory issues or timeouts. Pagination is definitely the preferred method to get more results than that. If you use pystac-client to interact with a pagination enabled stac api, the library completely takes care of the pagination for you and running an search returns an iterator that will transparently make all the paginated requests for you. |
Beta Was this translation helpful? Give feedback.
There is no max limit set in pgstac.
The max limit of 10,000 comes from here.
Unconstrained large limits run the risk of causing memory issues or timeouts.
Pagination is definitely the preferred method to get more results than that. If you use pystac-client to interact with a pagination enabled stac api, the library completely takes care of the pagination for you and running an search returns an iterator that will transparently make all the paginated requests for you.