HydrologicEngineeringCenter / cwms-data-api-client-javascript

A JavaScript wrapper for the CWMS Data API (CDA), a RESTful web service for managing water data. https://www.npmjs.com/package/cwmsjs The Documentation is the link below:

Home Page:https://hydrologicengineeringcenter.github.io/cwms-data-api-client-javascript/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CWMSjs

CWMS Data API (CDA) client library created with OpenAPI generator in TypeScript for use with web browsers.

Getting Started

  • Install CWMSjs to your react project with:
    npm install cwmsjs --save
    (This will grab the latest)

  • Import the API endpoint you wish to use:

    • Avaiable endpoints are here (Classes ending in API): Endpoints
    • At the top of your js/jsx/file type:
          import { TimeseriesAPI } from "cwmsjs"
    • Then initialize the TimeseriesAPI with:
          const tsa = new TimeseriesAPI()
    • Fetch timeseries data with:
          await ts_api.getCwmsDataTimeseries({
              "office": "SWT",
              "name": "KEYS.Elev.Inst.1Hour.0.Ccp-Rev",
          })
          .then((data) => {
              console.log(data)
          }).catch(e => { 
              console.log("My Error", e)
          })

Documentation is available for both developers and new users:

About

A JavaScript wrapper for the CWMS Data API (CDA), a RESTful web service for managing water data. https://www.npmjs.com/package/cwmsjs The Documentation is the link below:

https://hydrologicengineeringcenter.github.io/cwms-data-api-client-javascript/

License:MIT License


Languages

Language:TypeScript 88.7%Language:JavaScript 8.0%Language:HTML 2.0%Language:CSS 1.3%