The targets web service returns a list of targets having measurements for the specified metric. Targets can be filtered by station, network, etc. This channel list can be passed to the measurements service using command line tools such as curl.
Supplemental Information for Targets Service
Primary information in Measurements Service help
Much of the necessary supplemental patterns and examples can be found in the Measurements Service help page. The targets service is fairly limited in the parameters it uses, but there is an example for using the targets service to generate a SNCL list file that can then be fed to the measurements service. Please refer to the command line usage section there.