Repository navigation
feat: split Store search from the Store listing - #1273
Merged
Merged
Conversation
…sting `GET /v2/store` answers a request with `search` differently from one without it. A search returns the best matches as a single page of at most 100 Actors, ordered by relevance. It ignores `offset`, and reports the number of Actors returned as `total`. `store().iterate(search=...)` therefore requested the same page again and again, since the iterator stops only at a page with no rows. `StoreCollectionClient.search()` now covers the search: - one request with the query, `limit` and the `category`, `username`, `pricing_model` and `include_unrunnable_actors` filters, and no `offset` - returns a `StoreSearchResult` with `items` and the `limit` the API applied; `total` and `offset` of the response are left out, as they don't mean what they mean on a listing page - an empty query raises `ValueError`, as the API answers it with the listing The `search` and `sort_by` arguments of `list()` and `iterate()` are deprecated, each with a `DeprecationWarning`, for removal in v4. The API ignores `sort_by`. Until then, `iterate(search=...)` makes a single request and yields that one page, and `list(search=...)` works as before. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAGtCcLFHtTvqReATBj
search and sort_by in listing
vdusek
requested changes
Dec 2, 2026
Remove the integration test for a query without matches, which asserts what the API returns for it, and the `hasattr` assertions on the search result, which a dataclass can't fail. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAGtCcLFHtTvqReATBj
- Every page request of `iterate` sets the log context again, as it did when the callback went through the wrapped `list`. A client call between two pages no longer leaves its method name and resource ID on the next page request. - An empty `search` gets no deprecation warning, since it is not a search and the `search` method rejects it. - `StoreActor` is imported at runtime, so the annotations of `StoreSearchResult` resolve. - The `iterate` docstring says that `offset` and `chunk_size` have no effect with the deprecated `search`, the helper explains its `stacklevel`, and the docstrings write Apify Store as a proper noun. - Tests: the single-page test fails fast on a regression, the `sort_by` test proves a second page is requested, and the integration tests no longer expect exact item counts from the live search. - Docs: a "Search Apify Store" section with sync and async examples. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAGtCcLFHtTvqReATBj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
store().search(search, ...): the API answers a Store search with one page of at most 100 Actors by relevance, ignoresoffsetand reports the returned count astotal, so it returns aStoreSearchResultwithitemsandlimitonly.searchandsort_byonlist()anditerate()are deprecated for removal in v4, with aDeprecationWarning. Nothing is removed, since 3.x is released.iterate(search=...), which repeated the same page without end; it now makes one request.JS implementation: apify/apify-client-js#1267
Closes: #1270