[GS7 and HSDK] Category Search for places cuisine system
Question
You perform category search with Geocoding and Search API or HERE Navigate or Explore SDK but met the following error:<br />2025-08-25 13:57:54.724 23321-23384 hsdk-SearchErrorConvert com.lucid.map E Search error: HttpClientException, what: {"status":400,"title":"Illegal input for parameter 'categories'","cause":"Actual parameter value: '304-000'","action":"Each value of the comma separated string has to be a valid HERE Places Category ID","correlationId":"5d27c0b7-2dea-4034-aacb-a7714d8abdee","requestId":"REQ-60d4ea44-1c7f-4eae-9d4d-768ff9d2741c"}<br /><br />{ "status": 400, "title": "Illegal input for parameter 'categories'", "cause": "Actual parameter value: '304-000,315-000,404-000,101-004'", "action": "Each value of the comma separated string has to be a valid HERE Places Category ID", "correlationId": "b33cc371-96d4-40fc-8eda-e79656a9ff56", "requestId": "REQ-34a1fff4-e89f-4c43-8515-08556dc64fa4"}<br />
Cause
This is caused by inputting the foodTypes values from the places cuisine system into the categories field by mistake.
Refer to the following documentations for Geocoding and Search AIP and HERE SDK for details:
Places cuisine system > ...expose in their foodTypes field the available cuisine information...
Geocoding and Search API v7 API Reference > Browse > foodTypes
Class CategoryQuery > Fields > java.util.List includeFoodTypes List of food types to be included.
Class PlaceFoodType > Fields > java.lang.String id Identifier for an associated food type.
Resolution
For Geocoding and Search API, use the following API query sample for reference:<br />https://browse.search.hereapi.com/v1/browse?at=37.551095,-122.043716∈=circle:37.551095,-122.043716;r=5000&categories=100-1000&foodtypes=304-000,315-000,404-000,101-004<br />
For HERE SDK, use the following code snippet for reference:<br /> private void searchForCategories() { List categoryList = new ArrayList<>(); categoryList.add(new PlaceCategory(PlaceCategory.EAT_AND_DRINK_RESTAURANT)); List placeFoodTypeList = new ArrayList<>(); placeFoodTypeList.add(new PlaceFoodType("304-000")); placeFoodTypeList.add(new PlaceFoodType("315-000")); placeFoodTypeList.add(new PlaceFoodType("404-000")); placeFoodTypeList.add(new PlaceFoodType("101-004")); GeoCoordinates searchCenter = new GeoCoordinates(37.551095,-122.04371); CategoryQuery.Area queryArea = new CategoryQuery.Area(searchCenter, new GeoCircle(searchCenter, 5000)); CategoryQuery categoryQuery = new CategoryQuery(categoryList, queryArea); categoryQuery.includeFoodTypes = placeFoodTypeList; SearchOptions searchOptions = new SearchOptions(); searchOptions.languageCode = LanguageCode.EN_US; searchOptions.maxItems = 30; searchEngine.searchByCategory(categoryQuery, searchOptions, new SearchCallback() { @Override public void onSearchCompleted(SearchError searchError, List list) { if (searchError != null) { Toast.makeText(context, "Search Error: " + searchError.toString(), Toast.LENGTH_LONG).show(); return; } // If error is null, list is guaranteed to be not empty. String numberOfResults = "Search results: " + list.size() + ". See log for details."; Toast.makeText(context, numberOfResults, Toast.LENGTH_LONG).show(); for (Place searchResult : list) { String addressText = searchResult.getAddress().addressText; Log.d("CS0161641", addressText); GeoCoordinates geoCoordinates = searchResult.getGeoCoordinates(); addPoiMapMarker(geoCoordinates); } } }); }<br />
Result
The result from HERE SDK should be as follows:<br />2025-08-28 11:41:48.855 13895-13895 com.here.search D Dino's Grill, 5855 Jarvis Ave, Newark, CA 94560, United States2025-08-28 11:41:48.860 13895-13895 com.here.search D Afghan Awasana Kabob, 37012 Towers Way, Fremont, CA 94536-6543, United States2025-08-28 11:41:48.863 13895-13895 com.here.search D Calzone Life, 3691 Thornton Ave, Fremont, CA 94536-7423, United States2025-08-28 11:41:48.869 13895-13895 com.here.search D Vienna Bakery & Cafe, 5149 Mowry Ave, Fremont, CA 94536, United States2025-08-28 11:41:48.875 13895-13895 com.here.search D Massimos, 5200 Mowry Ave, Fremont, CA 94538, United States2025-08-28 11:41:48.884 13895-13895 com.here.search D Olive Garden Italian Restaurant, 39145 Farwell Dr, Fremont, CA 94538, United States2025-08-28 11:41:48.885 13895-13895 com.here.search D Gelato Classico Italian Ice Cream, 39191 Farwell Dr, Fremont, CA 94538, United States2025-08-28 11:41:48.896 13895-13895 com.here.search D Simply Pasta, 32106 Alvarado Blvd, Union City, CA 94587, United States<br />
The response from the Geocoding and Search API and the SDK sample project are also attached.