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