@@ -20,8 +20,8 @@ class MSStoreService {
2020 static const _fe3Delivery =
2121 "https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx" ;
2222 static const _storeAPI = "https://storeedgefd.dsx.mp.microsoft.com/v9.0" ;
23- static const _filteredSearchAPI =
24- "https://apps.microsoft.com/store/ api/Products/GetFilteredSearch " ;
23+ // static const _filteredSearchAPI = "https://apps.microsoft.com/store/api/Products/GetFilteredSearch";
24+ static const _searchAPI = "https://apps.microsoft.com/api/products/search " ;
2525 static final _optionsSoapXML = Options (
2626 headers: {
2727 "user-agent" :
@@ -101,11 +101,17 @@ class MSStoreService {
101101 Future <List <ProductsList >> searchProducts (String query) async {
102102 //"$_filteredSearchAPI?&Query=$query&FilteredCategories=AllProducts&hl=en-us${systemLanguage.toLowerCase()}&
103103 final response = await _dio.get (
104- "$_filteredSearchAPI ?&Query=$query &FilteredCategories=AllProducts&hl=en-us&gl=us" ,
104+ "$_searchAPI ?gl=US&hl=en-us&query=$query &mediaType=all&age=all&price=all&category=all&subscription=all" ,
105+
106+ // https://apps.microsoft.com/api/products/search?gl=GE&hl=en-us&query=xbox&cursor=
105107 options: _options);
106108
107109 if (response.statusCode == 200 ) {
108- return SearchResponse .fromJson (response.data).productsList ?? [];
110+ final responseData = SearchResponse .fromJson (response.data);
111+ return [
112+ ...(responseData.highlightedList ?? []),
113+ ...(responseData.productsList ?? []),
114+ ];
109115 }
110116 throw Exception ('Failed to search products' );
111117 }
0 commit comments