kd.js - Core library for KarmaData API
Usage
- React -
npm install karmadata
- CDN - Vist KarmaData CDN
Documents
- Quick Examples
- Detailed Documents
- KarmaData Developers Resources
- Release Notes
- Build CDN - internal use
Examples
KarmaData provides a versatile API to access our database of healthcare data. Here are examples of how to use the kd.js library to access KD API, starting from the simplest.
Example 1: retrieving a random list of 10 physicians
// create a kd requestconst request = kd;request;request; // Please obtain API key by contacting KarmaData // request data and wait for output// API defaults to returning 10 resultsrequest;request;
Example 2: retrieving physicians that are female sole proprietors (using filters)
// create filtersconst filter1 = kd;const filter2 = kd; // create request and add those filtersconst request = kd;request;request; // Please obtain API key by contacting KarmaDatarequest;request; // request data and wait for outputrequest;request;
Example 3: retrieving physicians that are female and belong to physician groups of size 5-10 (using FilterGroup)
// create filtersconst filter1 = kd;const filter2 = kd; // create request and add those filtersconst request = kd;request;request; // Please obtain API key by contacting KarmaDatarequestconst group = request;request; // request data and wait for outputrequest;request;
Example 4: retrieve physicians that are sole proprietors and sort by graduation year
// create filtersconst filter = kd; // create request and add those filtersconst request = kd;request;request; // Please obtain API key by contacting KarmaDatarequest; // adds sorting, then request data and wait for outputrequest;request;request;
Fluent Style
kd.js
now supports fluent style of constructing a request
let query = // Please obtain API key by contacting KarmaData rows1 10 ;query ;
Select
request example
let query = kd // Please obtain API key by contacting KarmaData rows1 100 ; query ;