ガイドAPIリファレンス変更履歴
ガイド

HERE Geocoding and Search API v7の利用開始

このセクションでは、HEREプラットフォームでHERE Geocoding and Searchの使用を迅速に開始する方法について説明します。

📘

このセクションでは、HERE Geocoding and Searchの使用を迅速に開始するために必要な最小限の設定について説明します。HEREアカウントの設定、プロジェクトの作成、サービスのリンク、アプリの登録、認証の詳細については、「Identity and Access Management - 管理者ガイド」を参照してください。

HEREアカウントを取得する

組織管理者からの招待状を通じて、または無料で利用を開始して、HEREプラットフォームへのアクセスを入手します。

  • 会社がすでにHEREプラットフォーム組織を設立している場合は、組織への参加に招待できる管理者に連絡してください。
  • 会社がまだHEREプラットフォーム組織を設立していない場合は、無料で利用を開始できます。詳細については、「HEREプラットフォームの価格設定」を参照してください。

APIキーを入手する

APIキーを入手するには、次の手順を実行します。

  1. HEREアカウントを使用してHEREプラットフォームにサインインします。
  2. ランチャーから[アクセスマネージャー]を開きます。
  3. [アプリ]タブを選択し、[新しいアプリを登録]をクリックします。
  4. アプリの名前を入力します。
  5. [登録]をクリックします。HEREプラットフォームで、一意のアプリIDを持つ新しいアプリが作成されます。
  6. [資格情報]タブで、[APIキー]を選択し、[APIキーを生成]をクリックして、アプリ認証資格情報用に最大2つのAPIキーを生成します。APIキーが作成され、表示されます。

リクエストを送信する

以下は 2 つのリクエスト例です。

検出リクエストジオコード リクエスト
(52.5228、13.4124) 付近のガソリン スタンドを 5 件取得するには、次のリクエストを送信します。自由形式のテキスト「Invalidenstr 117, Berlin」をジオコーディングするには、次のリクエストを送信します。

https://discover.search.hereapi.com/v1/ discover ?at=52.5228,13.4124 &q=petrol+station &apiKey={YOUR_API_KEY}

https://geocode.search.hereapi.com/v1/ geocode ?q=Invalidenstr+117+Berlin &apiKey={YOUR_API_KEY}

上のリクエストに対するレスポンスには複数の項目が含まれる場合があり、各項目には次の上位要素が含まれます。

  • resultType – HERE Geocoding and Search supports multiple location object types (place, street, locality, ...)
  • title – a representative string for the result, for instance the name of a place, or a complete address
  • address - a breakdown of the result address into its related fields
  • position - a representative geo-position (WGS 84) of the result; this is to be used to display the result on a map
  • access - the geo-position of the access to the result (for instance the entrance)
  • id - the identifier of the item. Its value can be used to retrieve the very same object using the /lookup endpoint.

Other elements are specific to the different HERE Geocoding and Search services/endpoints.

{
  "items": [
    {
      "title": "TOTAL",
      "id": "here:pds:place:276u33dc-2e01d17cb4a24c14bcad179ed8946016",
      "ontologyId": "here:cm:ontology:petrol_gasoline_station",
      "resultType": "place",
      "address": {
        "label": "TOTAL, Prenzlauer Allee 1-4, 10405 Berlin, Deutschland",
        "countryCode": "DEU",
        "countryName": "Deutschland",
        "stateCode": "BE",
        "state": "Berlin",
        "countyCode": "B",
        "county": "Berlin",
        "city": "Berlin",
        "district": "Prenzlauer Berg",
        "street": "Prenzlauer Allee",
        "postalCode": "10405",
        "houseNumber": "1-4"
      },
      "position": { "lat": 52.52896, "lng": 13.41802 },
      "access": [{ "lat": 52.52906, "lng": 13.41775 }],
      "distance": 783,
      "categories": [
        { "id": "700-7600-0116", "name": "Tankstelle", "primary": true },
        { "id": "100-1000-0009", "name": "Fastfood" },
        { "id": "700-7850-0121", "name": "Autowäsche/-reinigung" }
      ],
      "chains": [{ "id": "35" }],
      "references": [
        { "supplier": { "id": "core" }, "id": "50664440" },
        { "supplier": { "id": "yelp" }, "id": "OQn9q-QzNNu8v3eQQQIFNg" },
        { "supplier": { "id": "yelp" }, "id": "j926GEeY9jUex9ESkzJLJg" }
      ],
      "contacts": [
        {
          "phone": [
            { "value": "+49304425643" },
            { "value": "+4949304425643", "categories": [{ "id": "700-7600-0116" }] },
            { "value": "304-425643" }
          ],
          "fax": [
            { "value": "030 4417600", "categories": [{ "id": "700-7600-0116" }] },
            { "value": "304417600", "categories": [{ "id": "700-7600-0116" }] }
          ],
          "www": [
            {
              "value": "http://store.total.de/de/germany/store-total-de/berlin/berlin-prenzlauer-allee-1-4/ND020511",
              "categories": [{ "id": "700-7600-0116" }]
            },
            { "value": "http://store.total.de/de_DE/ND020511" },
            { "value": "http://www.total.de", "categories": [{ "id": "700-7600-0116" }] }
          ]
        }
      ],
      "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" }
          ]
        }
      ]
    },
    (...)
]
{
  "items": [
    {
      "title": "Invalidenstraße 117, 10115 Berlin, Deutschland",
      "id": "here:af:streetsection:tVuvjJYhO86yd5jk1cmzNB:CgcIBCCf2912EAEaAzExNyhk",
      "resultType": "houseNumber",
      "houseNumberType": "PA",
      "address": {
        "label": "Invalidenstraße 117, 10115 Berlin, Deutschland",
        "countryCode": "DEU",
        "countryName": "Deutschland",
        "stateCode": "BE",
        "state": "Berlin",
        "countyCode": "B",
        "county": "Berlin",
        "city": "Berlin",
        "district": "Mitte",
        "street": "Invalidenstraße",
        "postalCode": "10115",
        "houseNumber": "117"
      },
      "position": { "lat": 52.53041, "lng": 13.38527 },
      "access": [{ "lat": 52.53105, "lng": 13.3848 }],
      "mapView": { "west": 13.38379, "south": 52.52951, "east": 13.38675, "north": 52.53131 },
      "scoring": { "queryScore": 1, "fieldScore": { "city": 1, "streets": [1], "houseNumber": 1 } }
    }
  ]
}
📘

本番環境では OAuth トークンが推奨されます。この例ではapiKeyを使用して、すぐにAPIを試せるようにしています。

HERE Geocoding and Searchサービスには次のものがあります。

次のステップ

次のトピックを確認して、HERE Geocoding and Searchを正しく使用する方法を理解することをお勧めします。