From 39bfc3aae0c5cc5ba8acd0c9d073ca2fabda13bb Mon Sep 17 00:00:00 2001 From: Elisabetta D'Anastasio Date: Thu, 17 Apr 2025 12:41:04 +1200 Subject: [PATCH] add additional jq example for accessing Tilde API via bash --- Tilde/Bash_Tilde_Access.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tilde/Bash_Tilde_Access.md b/Tilde/Bash_Tilde_Access.md index 95aec4c..7a267c2 100644 --- a/Tilde/Bash_Tilde_Access.md +++ b/Tilde/Bash_Tilde_Access.md @@ -27,6 +27,10 @@ In this example, jq is extracting all JSON fields that have info on available st `curl --silent "${ip}/${v}/dataSummary/dart" | jq -r '.domain[] | .stations[] | .station'` +To extract a list of all available combinations of names and methods for a given domain, in a list separated by a tab: + +`curl --silent "${ip}/${v}/dataSummary/envirosensor" | jq -r '"\(.domain[].names[].name)\t\(.domain[].names[].methods[].method)"' | sort -u` + To visualise all metadata available via Tilde for a specific site, you can use the available API endpoint and then reformat the output with jq. This example is for NZE but to substitute for different sites or domains, change the domain name and the "station=NZE" section. `curl "${ip}/${v}/dataSummary/dart?station=NZE" | jq -r .`