Downloading Data

To download 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>

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

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.