 |
Web Services
In an effort to increase distribution and use of the data collected by the NERRS, the Centralized Data Management Office has created several web service products for this purpose. These services can be used to pull real-time data from our databases for use by other individuals and organizations.
You must contact cdmowebmaster@belle.baruch.sc.edu for authorization before pulling data from the CDMO.
Web Service Statistics
Hourly Statistics for 5/15/2025 1:00
|
Unique Users |
Stations Polled |
Records Pulled |
0 |
0 |
0 |
Daily Statistics for 5/15/2025
|
Unique Users |
Stations Polled |
Records Pulled |
0 |
0 |
0 |
|
|
Transmission Time Schedule
- Realtime satellite transmissions are received hourly based upon the diagram shown below. Decoding occurs at 11 minutes past the hour and 41 minutes past the hour. This data becomes available on the CDMO website at 15 and 45 minutes past the hour. Each transmission will have 4 15-minute records in it.
- What does all this mean? Let's take Block #5 as an example. Three stations are transmitted in that block from 47:00 - 47:30 past the hour. The data from those stations will be decoded at 11 minutes past the hour and will be available on this website at 15 minutes past the hour.
- What would be the best time to pull data from the website for Block #5?
Answer: We recommend 16 or 17 minutes after the hour.

Link to web service:
Available Functions:
- exportStationCodesXML - This function returns the following XML data:
NERR_Site_ID, Station_Code, Station_Name, Latitude/Longitude (in degrees), Latitude (in decimal), Longitude (in decimal), Active Status, Active Dates, State, Reserve_Name, the parameters reported for all stations, and a Real Time bit.
- NERRFilterStationCodesXML - This function returns the following XML data:
NERR_Site_ID, Station_Code, Station_Name, Latitude/Longitude (in degrees), Latitude (in decimal), Longitude (in decimal), Active Status, Active Dates, State, Reserve_Name, and the parameters reported for all stations associated with a particular NERR Site.
- exportSingleParamXML - This function returns the following XML data:
DateTimeStamp, user-requested-parameter.
- exportAllParamsDateRangeXML - This function returns all parameters with DateTimeStamps greater than the mindate and less than or equal to the maxdate.
Function Arguments:
- exportStationCodesXML - No arguments required for this function.
- NERRFilterStationCodesXML - Only one parameter required: NERR Site ID.
- exportSingleParamXML - The user must supply 3 arguments: Station_Code, number of records to retrieve, and the parameter tested.
- exportAllParamsDateRangeXML - The user must supply 4 arguments: Station_Code, mindate, maxdate, and the parameter tested.
Helpful Hints:
- We recommend calling the exportStationCodesXML function first! This will give you the Station Codes for each station and the parameters reported for that station. Once you know what station and parameter data you want to pull, you will be able to format the arguments for the exportSingleParamXML function.
- You can actually pull more that one parameter at a time by simply separating each parameter with a comma! See example code below.
- Flag codes can be returned for any parameter. The naming schema for the flag fieldname is F_parameter. Example flag column for pH is F_pH.
PHP Code Example:
- In order for you to use PHP to call our web services, you must download NuSOAP here. Unzip the files and place them in a directory where your PHP file will be located on your web server.
- Here is an example for calling the exportStationCodesXML function:
<?php
require_once('lib/nusoap.php');
$wsdl=new soapclient('http://cdmo.baruch.sc.edu/webservices/xmldatarequest.cfc?wsdl');
$wsdl->call('exportStationCodesXML');
echo 'Response: <xmp>'.$wsdl->response.'</xmp>';
?>
- Here is an example for calling the NERRFilterStationCodesXML function to pull Station Code records for North Inlet Winyah Bay (NIW) Reserve:
<?php
require_once('lib/nusoap.php');
$wsdl=new soapclient('http://cdmo.baruch.sc.edu/webservices/xmldatarequest.cfc?wsdl');
$wsdl->call('NERRFilterStationCodesXML', array('NERRFilter'=>'niw'));
echo 'Response: <xmp>'.$wsdl->response.'</xmp>';
?>
- Here is an example for calling the exportSingleParamXML function to return the last 4 pH records from North Inlet Oyster Landing Water Quality Station niwolwq:
<?php
require_once('lib/nusoap.php');
$wsdl=new soapclient('http://cdmo.baruch.sc.edu/webservices/xmldatarequest.cfc?wsdl');
echo $wsdl->call('exportSingleParamXML',
array('tbl'=>'niwolwq','numrecs'=>'4','param'=>'pH'));
echo 'Response: <xmp>'.$wsdl->response.'</xmp>';
?>
- Here is an example for calling the exportSingleParamXML function to return the last 4 pH records and pH flag codes from North Inlet Oyster Landing Water Quality Station niwolwq:
<?php
require_once('lib/nusoap.php');
$wsdl=new soapclient('http://cdmo.baruch.sc.edu/webservices/xmldatarequest.cfc?wsdl');
echo $wsdl->call('exportSingleParamXML',
array('tbl'=>'niwolwq','numrecs'=>'4','param'=>'pH,F_pH'));
echo 'Response: <xmp>'.$wsdl->response.'</xmp>';
?>
- Here is an example for calling the exportSingleParamXML function to return the last 4 pH, pH flag codes, DO_pct, and DO_pct flag codes from North Inlet Oyster Landing Water Quality Station niwolwq:
<?php
require_once('lib/nusoap.php');
$wsdl=new soapclient('http://cdmo.baruch.sc.edu/webservices/xmldatarequest.cfc?wsdl');
echo $wsdl->call('exportSingleParamXML',
array('tbl'=>'niwolwq','numrecs'=>'4','param'=>'pH,F_pH,DO_pct,F_DO_pct'));
echo 'Response: <xmp>'.$wsdl->response.'</xmp>';
?>
- Here is an example for calling the exportAllParamsDateRangeXML function to return all parameters with DateTimeStamps greater than the mindate and less than or equal to the maxdate. If you include a fieldlist, only those parameters will be returned to you.
<?php
require_once('lib/nusoap.php');
$wsdl=new soapclient('http://cdmo.baruch.sc.edu/webservices/xmldatarequest.cfc?wsdl');
echo $wsdl->call('exportAllParamsDateRangeXML',
array('tbl'=>'niwolwq','mindate'=>'12/06/2006','maxdate'=>'12/07/2007','fieldlist'=>'*'));
echo 'Response: <xmp>'.$wsdl->response.'</xmp>';
?>
Cold Fusion Code Example:
- Here is an example for calling the exportStationCodesXML function:
<cfinvoke
webservice="http://cdmo.baruch.sc.edu/webservices/xmldatarequest.cfc?wsdl"
method="exportStationCodesXML"
returnvariable="aString">
</cfinvoke>
<!--- Output results --->
<cfset aString = #XMLParse(aString)#>
<cfdump var="#aString#">
- Here is an example for calling the NERRFilterStationCodesXML function to pull Station Code records for North Inlet Winyah Bay (NIW) Reserve:
<cfinvoke
webservice="http://cdmo.baruch.sc.edu/webservices/xmldatarequest.cfc?wsdl"
method="NERRFilterStationCodesXML"
returnvariable="aString">
<cfinvokeargument name="NERRFilter" value="niw"/>
</cfinvoke>
<!--- Output results --->
<cfset aString = #XMLParse(aString)#>
<cfdump var="#aString#"> --->
- Here is an example for calling the exportSingleParamXML function to return the last 4 pH records from North Inlet Oyster Landing Water Quality Station niwolwq:
<cfinvoke
webservice="http://cdmo.baruch.sc.edu/webservices/xmldatarequest.cfc?wsdl"
method="exportSingleParamXML"
returnvariable="aString">
<cfinvokeargument name="tbl" value="niwolwq"/>
<cfinvokeargument name="numrecs" value="4"/>
<cfinvokeargument name="param" value="pH"/>
</cfinvoke>
<!--- Output results --->
<cfset aString = #XMLParse(aString)#>
<cfdump var="#aString#">
- Here is an example for calling the exportSingleParamXML function to return the last 4 pH records and pH flag codes from North Inlet Oyster Landing Water Quality Station niwolwq:
<cfinvoke
webservice="http://cdmo.baruch.sc.edu/webservices/xmldatarequest.cfc?wsdl"
method="exportSingleParamXML"
returnvariable="aString">
<cfinvokeargument name="tbl" value="niwolwq"/>
<cfinvokeargument name="numrecs" value="4"/>
<cfinvokeargument name="param" value="pH,F_pH"/>
</cfinvoke>
<!--- Output results --->
<cfset aString = #XMLParse(aString)#>
<cfdump var="#aString#">
- Here is an example for calling the exportSingleParamXML function to return the last 4 pH, pH flag codes, DO_pct, and DO_pct flag codes from North Inlet Oyster Landing Water Quality Station niwolwq:
<cfinvoke
webservice="http://cdmo.baruch.sc.edu/webservices/xmldatarequest.cfc?wsdl"
method="exportSingleParamXML"
returnvariable="aString">
<cfinvokeargument name="tbl" value="niwolwq"/>
<cfinvokeargument name="numrecs" value="4"/>
<cfinvokeargument name="param" value="pH,F_pH,DO_pct,F_DO_pct"/>
</cfinvoke>
<!--- Output results --->
<cfset aString = #XMLParse(aString)#>
<cfdump var="#aString#">
- Here is an example for calling the exportAllParamsDateRangeXML function to return all parameters with DateTimeStamps greater than the mindate and less than or equal to the maxdate. If you include a fieldlist, only those parameters will be returned to you.
<cfinvoke
webservice="http://cdmo.baruch.sc.edu/webservices/xmldatarequest.cfc?wsdl"
method="exportAllParamsDateRangeXML"
returnvariable="aString">
<cfinvokeargument name="tbl" value="niwolwq"/>
<cfinvokeargument name="mindate" value="12/12/2006"/>
<cfinvokeargument name="maxdate" value="12/13/2006"/>
<cfinvokeargument name="fieldlist" value="*"/>
</cfinvoke>
<!--- Output results --->
<cfset aString = #XMLParse(aString)#>
<cfdump var="#aString#">
Perl Code Example:
- Here is an example for calling the exportStationCodesXML function.
Note there is NO error checking in either example. Anyone who would want to use these in a production/operational mode would need to flesh them out a little to check that there were no SOAP errors... and to handle them in a reasonable manner, if there were.
#!perl
# Description: Simple SOAP client to pull stations from the NERRS/CDMO SOAP Services.
# Date: 20070529
# Author: John R. Ulmer (PSGS Contractor for the NOAA CSC)
# ___________________________________________________________________________
use strict;
use SOAP::Lite; # qw(trace);
my ($endpoint, $uri, $method, $method_urn);
$endpoint = "http://cdmo.baruch.sc.edu/webservices/xmldatarequest.cfc";
$uri = "http://uri.not";
$method = 'exportStationCodesXML';
my $soap = SOAP::Lite
->uri($uri)
->proxy($endpoint)
->outputxml(1);
my $response = $soap->$method();
open (OPF, ">cdmo_stations.xml") or die "Failed to open output file, $!\n";
print OPF "$response\n";
close OPF;
print "$response \nDone\n";
- Here is an example for calling the exportSingleParamXML function.
#!perl
# Description: Simple SOAP client to pull data from the NERRS/CDMO SOAP Services.
# Date: 20070529
# Author: John R. Ulmer (PSGS Contractor for the NOAA CSC)
# ___________________________________________________________________________
use strict;
use SOAP::Lite; # qw(trace);
unless ($ARGV[2] =~ /\w/){ print "Should have 3 command line arguments.\n";
print "USAGE: client_cdmo_data.pl stationID numRecs Parameter.\n";
print "Example: client_cdmo_data.pl niwolwq 10 Temp<Enter>\n";
die;
}
# Get cmd line args.
my ($stationID, $numRecs, $obsProperty) = @ARGV;
my ($endpoint, $uri, $method, $method_urn);
$endpoint = "http://cdmo.baruch.sc.edu/webservices/xmldatarequest.cfc";
$uri = "http://uri.not";
$method = 'exportSingleParamXML';
my $soap = SOAP::Lite
->uri($uri)
->proxy($endpoint)
->outputxml(1);
my $response = $soap->$method(SOAP::Data->name(tbl => "$stationID"),
SOAP::Data->name(numrecs => "$numRecs"),
SOAP::Data->name(param => "$obsProperty"));
open (OPF, ">cdmo_data.xml") or die "Failed to open output file, $!\n";
print OPF "$response\n";
close OPF;
print "\nDone\n";
|
Revised
by cdmo.baruch.sc.edu Webmaster
Site hosted by NOAA National Estuarine Research Reserve, Centralized Data Management Office. Real time data displayed with help from the National Weather Service (NWS)
and the Hydrometeorological Automated Data Service (HADS) |
|