本文へスキップ

Downloading Harvest Data

To download data from Harvest Data, first open the Harvest Data screen for one or more devices by following the instructions in the Viewing Data documen...

コピー/保存

このページはまだ日本語では利用できません。現在は英語版を表示しています。ブラウザの翻訳機能をご利用ください。

ブラウザで翻訳する
  • Chrome / Edge: アドレスバーの翻訳アイコン、またはページを右クリックして「日本語に翻訳」を選択してください。
  • Safari: アドレスバーの「aA」メニューから「翻訳」を選択してください。

翻訳メニューが表示されない場合は、ブラウザ設定で翻訳機能が有効になっているか確認してください。

英語版を見る

Downloading Data

To download data from Harvest Data, first open the Harvest Data screen for one or more devices by following the instructions in the Viewing Data documentation.

Below the chart, click the **Download ** menu, then select the data format you want to download.

Once the data has been prepared, your download will begin automatically.

You can only download up to 1,000 lines of data at a time. ! To extract more data, follow the steps in the Programmatic Usage section below.

Note that all Harvest Data access is counted as a data export when the Extended Data Retention option is enabled. This includes viewing data in the User Console, requesting data via the Soracom API/CLI, and accessing data through Soracom Lagoon. Refer to the Pricing & Fee Schedule for more information..

Programmatic Usage

You can also use the Soracom API or Soracom CLI to download data.

Soracom API

To access the Soracom API, first use the auth API to obtain an API Key and Token. Refer to the API Usage Guide for instructions on how to use the API Key and Token in API requests.

Then, use the getDataEntries API to retrieve data uploaded from a subscriber to Harvest Data, specifying the subscriber IMSI in the request URL:

curl -X GET \
|  -H "X-Soracom-API-Key: <MY-API-KEY>" \
|  -H "X-Soracom-Token: <MY-TOKEN>" \
|  -H "Accept: application/json" \
|  https://g.api.soracom.io/v1/data/Subscriber/<IMSI>
curl -X GET \
|  -H "X-Soracom-API-Key: <MY-API-KEY>" \
|  -H "X-Soracom-Token: <MY-TOKEN>" \
|  -H "Accept: application/json" \
|  https://jp.api.soracom.io/v1/data/Subscriber/<IMSI>

Data will be returned in JSON format:

[
  {
    "resourceType": "Subscriber",
    "resourceId": "<IMSI>",
    "category": "myCategory",
    "time": 1479350871000,
    "contentType": "application/json",
    "content": "{\"temperature\":20}"
  },
  {
    "resourceType": "Subscriber",
    "resourceId": "<IMSI>",
    "category": "myCategory",
    "time": 1479350881000,
    "contentType": "application/json",
    "content": "{\"temperature\":25}"
  },
  {
    "resourceType": "Subscriber",
    "resourceId": "<IMSI>",
    "category": "myCategory",
    "time": 1479350891000,
    "contentType": "application/json",
    "content": "{\"temperature\":20}"
  }
]

You can use from (Unix milliseconds), to (Unix milliseconds), sort (asc or desc), and limit query parameters in the request URL, such as https://g.api.soracom.io/v1/data/Subscriber/<IMSI>?from=<FROM>&to=<TO>&sort=asc&limit=100 in order to control the range of data.

You can also use the getDataEntriesByCategory API to retrieve the data by filtering the category name specified in your group configuration.

Soracom CLI

To use the Soracom CLI, you must first configure it to authenticate with your account information, authorization key, or SAM user credentials.

Then, run the following command to retrieve data uploaded from a subscriber to Harvest Data:

soracom data get-entries --resource-type "Subscriber" --resource-id "<IMSI>" --coverage-type g
soracom data get-entries --resource-type "Subscriber" --resource-id "<IMSI>" --coverage-type jp

The CLI will return data in JSON format following the API example above.

Similar to the API usage, you can use the --from, --to, --sort, and --limit flags to control the range of data.

検索 Escで閉じる / Enterで検索結果