# Helium API Examples

```
$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt
```

Usage:

```
$ export HELIUM_API_KEY="YOUR_API_KEY"
$ # second argument is a datasource id, from:
$ # ex: https://my.helium.com/datasource/4XlUNRMSTVasLpehlybrGQ
$ ./temperature-history.py -k $HELIUM_API_KEY -d '4XlUNRMSTVasLpehlybrGQ'
$ # optionally pass -j to get temp.json raw json output
$ head temp.csv
timestamp-utc,temperature-celsius
2016-01-07T18:21:16Z,22.7143
2016-01-07T18:20:15Z,22.7429
2016-01-07T18:19:14Z,22.6857
2016-01-07T18:18:13Z,22.7429
2016-01-07T18:17:12Z,22.7714
2016-01-07T18:16:11Z,22.8
2016-01-07T18:15:10Z,22.8
2016-01-07T18:14:09Z,22.7714
2016-01-07T18:13:08Z,22.7143
```

# Helium API Examples

## Setup

```
$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt
```

## Usage

Run each script with `-h` to get help on running the script and what
parameters it supports

For example:


``` shellsession
./sensor-timeseries.py -h
usage: sensor-timeseries.py [-h] [-f {csv,json}] [-s PAGE_SIZE]
                            [-p PORT [PORT ...]] [-o [OUTPUT]] -k API_KEY
                            sensor_id

positional arguments:
  sensor_id             The sensor id to get timeseries data for

optional arguments:
  -h, --help            show this help message and exit
  -f {csv,json}, --format {csv,json}
                        The output format for the results (default 'csv')
  -s PAGE_SIZE, --page-size PAGE_SIZE
                        The page size for each page
  -p PORT [PORT ...], --port PORT [PORT ...]
                        The ports to filter readings on
  -o [OUTPUT], --output [OUTPUT]
                        The output to write to (default stdout)
  -k API_KEY, --api-key API_KEY
                        Your Helium API key
```

Update setup and usage instructions
Update setup and usage instructions
