@@ -784,6 +784,78 @@ def getDataProducts(self, filters: dict | None = None):
784784 ]
785785 """ # noqa: E501
786786 return self .discovery .getDataProducts (filters )
787+
788+ def getDataAvailability (self , filters : dict | None = None ):
789+ """
790+ Return information about which data products are available at a given time.
791+
792+ The API endpoint is ``/dataAvailability/dataproducts``.
793+
794+ See https://data.oceannetworks.ca/OpenAPI#get-/dataAvailability/dataproducts
795+ for usage and available filters.
796+
797+ Parameters
798+ ----------
799+ filters : dict, optional
800+ Query string parameters in the API request.
801+
802+ Supported parameters are:
803+
804+ - locationCode
805+ - deviceCategoryCode
806+ - deviceCode
807+ - propertyCode
808+ - dateFrom
809+ - dateTo
810+ - dataProductCode
811+ - extension
812+ - minimumCoverage
813+ - maximumCoverage
814+ - getLatest
815+ - groupBy
816+ - mergeGaps
817+ - includeEmptyDays
818+ - rowLimit
819+
820+ Returns
821+ -------
822+ list of dict
823+ API response.
824+
825+ Examples
826+ --------
827+ >>> params = {
828+ ... "locationCode": "NCBC",
829+ ... "deviceCategoryCode": "BPR",
830+ ... "dateFrom": "2019-11-23",
831+ ... "dateTo": "2019-11-30",
832+ ... } # doctest: +SKIP
833+ >>> onc.getDataAvailability(params) # doctest: +SKIP
834+ {
835+ "availableDataProducts": [
836+ {
837+ "averageFileCoverage": 0.875,
838+ "dataProductCode": "LF",
839+ "dateFrom": "2019-11-23T00:00:00.000Z",
840+ "dateTo": "2019-12-01T00:00:00.000Z",
841+ "deviceCode": "BPR-Folger-59",
842+ "extension": "txt",
843+ "fileCount": 7,
844+ "maxFileCoverage": 1.0,
845+ "maxFileCoverageDate": "2019-11-23T00:00:00.000Z",
846+ "minFileCoverage": 0.0,
847+ "minFileCoverageDate": "2019-11-30T00:00:00.000Z",
848+ "totalFileSize": 8707618,
849+ "totalUncompressedFileSize": 33868912,
850+ }
851+ ],
852+ "messages": [],
853+ "next": None,
854+ "queryUrl": "https://data.oceannetworks.ca/api/dataAvailability/dataproducts?locationCode=NCBC&deviceCategoryCode=BPR&dateFrom=2019-11-23&dateTo=2019-11-30&token=ONC_TOKEN",
855+ }
856+
857+ """ # noqa: E501
858+ return self .discovery .getDataAvailability (filters )
787859
788860 # Delivery methods
789861
0 commit comments