README.md
March 3, 2023 ยท View on GitHub
DataStream.sh
DataStream.org API helper. See API documentation for query string values and structure.
Install (MacOS)
curl -o /usr/local/bin/datastreamsh https://raw.githubusercontent.com/datastreamapp/datastreamsh/main/datastream.sh
chmod +x /usr/local/bin/datastreamsh
Use
This package has been tested on MacOS.
datastreamsh command [options...]
Commands
setup: Prompts for API key, will be save to~/.datastreamin plain text. Not setting up will prompt forx-api-keyon ever command.metadata: Wraps /v1/odata/v4/Metadata API endpointlocations: Wraps /v1/odata/v4/Locations API endpointobservations: Wraps /v1/odata/v4/Observations API endpointrecords: Wraps /v1/odata/v4/Records API endpoint
Options
--select: What parameters to be returned--filter: What you want to , in OData format--format: Print output in alternative format (Allowed:JSONSTREAM,CSV; Default:JSONSTREAM)--top: Number of results to return per request (Default: 10000)--domain: Use to point at testing environments
Example: Setup
# datastreamsh setup
$ datastreamsh setup
x-api-key: # copy and paste API key here and press enter
Example: Basic
# datastreamsh command [options...]
$ datastreamsh locations --select "..." --filter "..."
Example: save as CSV to file
# datastreamsh command --format CSV --select <select> [options...]
$ datastreamsh records --format CSV --select "..." --filter "..." > file.csv