Search for places by category near a location
This tutorial demonstrates how to search for places near a locality.
Procedure
To search 5 Obi places in Hamburg from the geo-position (52.81730,12.23683)
, send the following request:
GET https://discover.search.hereapi.com/v1/
discover
?at=52.8173086,12.2368342
&limit=2
&lang=en
&q=Obi+Hamburg
&apiKey={YOUR_API_KEY}
The following parameters are used:
- at - Specify the center of the search context expressed as coordinates.
- limit - Maximum number of results to be returned.
- lang - Select the language to be used for result rendering from a list of BCP 47 compliant language codes.
- q - Enter a free-text query.
- apiKey - Your API key.
The result lists detailed information about the related location objects:
{
"items": [
{
"title": "OBI",
"id": "here:pds:place:276jx7ps-d60b21a41707034c23961246181c0373",
"ontologyId": "here:cm:ontology:obi",
"resultType": "place",
"address": {
"label": "OBI, Ruhrstraße, 22761 Hamburg, Germany",
"countryCode": "DEU",
"countryName": "Germany",
"stateCode": "HH",
"state": "Hamburg",
"countyCode": "HH",
"county": "Hamburg",
"city": "Hamburg",
"district": "Bahrenfeld",
"street": "Ruhrstraße",
"postalCode": "22761"
},
"position": { "lat": 53.56552, "lng": 9.92562 },
"access": [{ "lat": 53.56552, "lng": 9.92562 }],
"distance": 175004,
"categories": [
{ "id": "600-6600-0077", "name": "Home Improvement/Hardware Store", "primary": true },
{ "id": "600-6600-0080", "name": "Furniture Store" },
{ "id": "600-6600-0082", "name": "Garden Center" },
{ "id": "600-6600-0085", "name": "Major Appliance" },
{ "id": "600-6900-0000", "name": "Consumer Goods" },
{ "id": "600-6900-0095", "name": "Office Supply & Services Store" },
{ "id": "700-7200-0263", "name": "Locksmiths and Security Systems Services" },
{ "id": "700-7200-0274", "name": "Rental and Leasing" }
],
"chains": [{ "id": "4502" }],
"references": [
{ "supplier": { "id": "core" }, "id": "1148722020" },
{ "supplier": { "id": "yelp" }, "id": "_-iPBFnJKpJT94H1jHNmfQ" }
],
"contacts": [
{
"phone": [{ "value": "+494089726420" }],
"www": [
{ "value": "https://www.obi.de/baumarkt/hamburg-altona/?wt_mc=port.de497_Hamburg-Altona" },
{ "value": "https://www.obi.de/baumarkt/hamburg-altona/?wt_mc=port.de497_Hamburg-Altona..." },
{ "value": "https://www.obi.de/baumarkt/hamburg-altona/?wt_mc=port.de.de497_Hamburg-Altona..." }
],
"email": [{ "value": "hamburg-altona@obi.de" }, { "value": "service@obi.de" }]
}
],
"openingHours": [
{
"text": ["Mon-Sat: 08:00 - 20:00"],
"isOpen": true,
"structured": [{ "start": "T080000", "duration": "PT12H00M", "recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR,SA" }]
}
]
},
{
"title": "Obi Markt Hamburg-Eppendorf",
"id": "here:pds:place:276jx7ps-0697ddb404a60f0a92391fe6daa60a0f",
"ontologyId": "here:cm:ontology:obi",
"resultType": "place",
"address": {
"label": "Obi Markt Hamburg-Eppendorf, Nedderfeld 100, 22529 Hamburg, Germany",
"countryCode": "DEU",
"countryName": "Germany",
"stateCode": "HH",
"state": "Hamburg",
"countyCode": "HH",
"county": "Hamburg",
"city": "Hamburg",
"district": "Eppendorf",
"street": "Nedderfeld",
"postalCode": "22529",
"houseNumber": "100"
},
"position": { "lat": 53.6013, "lng": 9.97856 },
"access": [{ "lat": 53.6015, "lng": 9.97861 }],
"distance": 173816,
"categories": [
{ "id": "600-6600-0077", "name": "Home Improvement/Hardware Store", "primary": true },
{ "id": "600-6600-0080", "name": "Furniture Store" },
{ "id": "600-6600-0082", "name": "Garden Center" },
{ "id": "600-6600-0085", "name": "Major Appliance" },
{ "id": "600-6900-0095", "name": "Office Supply & Services Store" },
{ "id": "600-6900-0097", "name": "Pet Supply" },
{ "id": "600-6900-0098", "name": "Warehouse/Wholesale Store" },
{ "id": "700-7200-0274", "name": "Rental and Leasing" }
],
"chains": [{ "id": "4502" }],
"references": [
{ "supplier": { "id": "core" }, "id": "1163120081" },
{ "supplier": { "id": "yelp" }, "id": "GOBoHmG6pi2BP039KwrIRw" }
],
"contacts": [
{
"phone": [{ "value": "+494051326380" }],
"www": [
{ "value": "https://www.obi.de/baumarkt/hamburg-eppendorf/?wt_mc=port.de281_Hamburg-Eppendorf" },
{ "value": "https://www.obi.de/baumarkt/hamburg-eppendorf/?wt_mc=port.de281_Hamburg-Eppendorf..." },
{ "value": "https://www.obi.de/baumarkt/hamburg-eppendorf/?wt_mc=port.de.de281_Hamburg-Eppendorf..." }
],
"email": [{ "value": "Hamburg-Eppendorf@obi.de" }, { "value": "service@obi.de" }]
}
],
"openingHours": [
{
"text": ["Mon-Fri: 07:00 - 20:00", "Sat: 08:00 - 20:00"],
"isOpen": true,
"structured": [
{ "start": "T070000", "duration": "PT13H00M", "recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR" },
{ "start": "T080000", "duration": "PT12H00M", "recurrence": "FREQ:DAILY;BYDAY:SA" }
]
}
]
}
]
}
Similarly, to place chains near address locations HERE Geocoding and Search also supports search use cases about place categories near address locations.
For more information about /discover
parameters, see: API Reference.