カテゴリを使用してplacesを検索

このチュートリアルでは、カテゴリを使用してを検索する方法について説明します。

プロシージャ

地理的位置(42.36309,-71.05495) のホテルを半径 100 m 以内で検索するには、次のリクエストを送信します。

GET https://discover.search.hereapi.com/v1/
    discover
    ?in=circle:42.36309,-71.05495;r=150
    &q=hotels
    &apiKey={YOUR_API_KEY}

次のパラメータが使用されます。

  • In-地理的領域内で検索します。 結果が指定した領域にある場合は、結果が返されます。
  • Q - フリーテキストのクエリを入力します。
  • apiKey - お客様の API キー 。

この要求は API キー 認証を使用します。 HERE platform の認証オプションの詳細については、『ID およびアクセス管理ガイド』を参照してください。

結果には、関連するロケーションオブジェクトに関する詳細情報が一覧表示されます。

{
  "items": [
    {
      "title": "Bricco",
      "id": "here:pds:place:840drt2z-da7d929da56241ab90a63e9b04581a3e",
      "ontologyId": "here:cm:ontology:hotel",
      "resultType": "place",
      "address": {
        "label": "Bricco, 241 Hanover St, Boston, MA 02113, United States",
        "countryCode": "USA",
        "countryName": "United States",
        "stateCode": "MA",
        "state": "Massachusetts",
        "county": "Suffolk",
        "city": "Boston",
        "district": "North End",
        "street": "Hanover St",
        "postalCode": "02113",
        "houseNumber": "241"
      },
      "position": { "lat": 42.36309, "lng": -71.05495 },
      "access": [{ "lat": 42.36315, "lng": -71.05511 }],
      "distance": 0,
      "categories": [
        { "id": "500-5000-0000", "name": "Hotel/Motel", "primary": true },
        { "id": "100-1000-0000", "name": "Restaurant" },
        { "id": "100-1000-0001", "name": "Casual Dining" },
        { "id": "500-5000-0053", "name": "Hotel" }
      ],
      "references": [
        { "supplier": { "id": "core" }, "id": "1210790443" },
        { "supplier": { "id": "core" }, "id": "1212952865" },
        { "supplier": { "id": "core" }, "id": "31259419" },
        { "supplier": { "id": "tripadvisor" }, "id": "322039" },
        { "supplier": { "id": "tripadvisor" }, "id": "3952875" },
        { "supplier": { "id": "yelp" }, "id": "55PGG2U1z-q7Z694F-B-_w" },
        { "supplier": { "id": "yelp" }, "id": "HeUnLUCbZp14okbOuUQuig" }
      ],
      "foodTypes": [{ "id": "304-000", "name": "Italian", "primary": true }, { "id": "800-075", "name": "Seafood" }],
      "contacts": [
        {
          "phone": [{ "value": "+16172486800" }, { "value": "+16174591293" }],
          "fax": [{ "value": "+16173670666" }],
          "www": [
            { "value": "http://www.bricco.com" },
            { "value": "https://briccosuites.com" }
          ],
          "email": [{ "value": "briccosuites@dventures.net" }]
        }
      ],
      "openingHours": [
        {
          "text": ["Mon-Sat: 00:00 - 23:00", "Sun: 16:00 - 23:00"],
          "isOpen": true,
          "structured": [
            { "start": "T000000", "duration": "PT23H59M", "recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR,SA" },
            { "start": "T160000", "duration": "PT07H00M", "recurrence": "FREQ:DAILY;BYDAY:SU" }
          ]
        }
      ]
    },
    {
      "title": "Mariners House",
      "id": "here:pds:place:840drt3p-352341af037d4adebf8cf857356b53db",
      "ontologyId": "here:cm:ontology:hotel",
      "resultType": "place",
      "address": {
        "label": "Mariners House, 11 North Sq, Boston, MA 02113, United States",
        "countryCode": "USA",
        "countryName": "United States",
        "stateCode": "MA",
        "state": "Massachusetts",
        "county": "Suffolk",
        "city": "Boston",
        "district": "North End",
        "street": "North Sq",
        "postalCode": "02113",
        "houseNumber": "11"
      },
      "position": { "lat": 42.36391, "lng": -71.05362 },
      "access": [{ "lat": 42.36388, "lng": -71.0535 }],
      "distance": 142,
      "categories": [
        { "id": "500-5000-0000", "name": "Hotel/Motel", "primary": true },
        { "id": "200-2000-0000", "name": "Nightlife-Entertainment" },
        { "id": "300-3000-0000", "name": "Landmark-Attraction" },
        { "id": "500-5000-0053", "name": "Hotel" }
      ],
      "references": [{ "supplier": { "id": "core" }, "id": "1211051251" }],
      "contacts": [
        {
          "phone": [{ "value": "+16172270564" }, { "value": "+16172273979" }, { "value": "+16172274201" }],
          "fax": [{ "value": "+18777329494" }],
          "www": [
            { "value": "http://www.marinershouse.org/" }
          ],
          "email": [{ "value": "inn@marinershouse.org" }]
        }
      ],
      "openingHours": [
        {
          "text": ["Mon-Sun: 00:00 - 24:00"],
          "isOpen": true,
          "structured": [
            { "start": "T000000", "duration": "PT24H00M", "recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR,SA,SU" }
          ]
        }
      ]
    }
  ]
}

追加情報

/discover パラメータの詳細については、次のトピックを参照してください。 API リファレンス

」に一致する結果は 件です

    」に一致する結果はありません