Download OpenAPI specification:Download
Garner's APIs power its core provider recommendation experience. These recommendations are based on over 45 billion anonymized health insurance claims that paint a clear picture of a patient's journey through the healthcare system.
Using these data, Garner evaluates whether physicians practice evidence-based medicine as defined by major, respected healthcare journals. Garner has designed over 500 clinical and financial metrics that look closely at every decision a physician makes rather than relying on standard industry episode groupers. This results in rankings that are much more transparent and trustworthy and enable better-informed decisions for patients, physicians, and payers.
If you were provided a JWT at account setup rather than an API client id and client secret, please refer to instructions for legacy token authentication.
Garner APIs authenticate with OAuth 2.0 access tokens. You will be provided an API client ID and API client secret during account setup. The client ID and client secret can be exchanged for an access token which in turn authenticates your app when making calls to Garner's APIs.
To obtain an access token, make a request to the POST oauth2/token/
endpoint. In the request body, include the client_id
, client_secret
,
and grant_type=client_credentials
. This response will contain an access_token
, the token_type
which will always be "Bearer",
and expires_in
which is the lifetime in seconds of the token.
The access token can be used to authenticate with Garner's APIs. When making a request, provide the access token as a
bearer token in the Authorization
header.
For example,
JavaScript
/* Get the token */
const { access_token, token_type, expires_in } = await fetch('https://api.getgarner.com/oauth2/token', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
grant_type: 'client_credentials',
client_id: '<YOUR_API_CLIENT_ID_HERE>',
client_secret: '<YOUR_API_CLIENT_SECRET_HERE>',
}),
}).then(r => r.json());
/* Use the token */
const { providers } = fetch(
'https://api.getgarner.com/providers',
{
method: 'GET',
headers: {'Authorization': `Bearer ${<YOUR_ACCESS_TOKEN_HERE>}`},
query: ...
},
).then(response => response.json());
cURL
# Get the token
curl --location 'https://api.garner.health/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=<YOUR_API_CLIENT_ID_HERE' \
--data-urlencode 'client_secret=<YOUR_API_CLIENT_SECRET_HERE>'
# Use the token
curl -G https://api.getgarner.com/providers -H 'Authorization: Bearer <YOUR_ACCESS_TOKEN_HERE>'
The access token will only be valid for 15 minutes. We recommend caching the token in your application so that it can be reused up to its expiration. This can be managed by the app programmatically by implementing a GarnerTokenClient
class like the following:
class GarnerTokenClient {
/** Cached access token */
private currentToken: string | undefined;
/** Time at which the cached token expires */
private expirationTime: number | undefined;
/**
* Fetches a new access token from the `POST /oauth2/token` endpoint,
* then caches the token and its expiration time.
* Returns a promise that resolves to the newly fetched access token
*/
private async fetchNewToken(): Promise<string> {
const currentTime = Date.now();
const { access_token: accessToken, expires_in: expiresIn } = await fetch('https://api.getgarner.com/oauth2/token', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
grant_type: 'client_credentials',
client_id: '<YOUR_API_CLIENT_ID_HERE>',
client_secret: '<YOUR_API_CLIENT_SECRET_HERE>',
}),
}).then(r => r.json());
// Cache the access token
this.currentToken = accessToken;
// Set the expiration time as the current time plus the number of ms until the token expires. Subtract a 15 second buffer to account for lag.
this.expirationTime = (currentTime + expiresIn * 1000) - 15000;
return accessToken;
}
/**
* Returns the cached access token if it is valid.
* Otherwise, fetches a new token.
*/
async getToken(): Promise<string> {
if (this.currentToken && this.expirationTime && Date.now() < this.expirationTime) {
return this.currentToken;
}
return await this.fetchNewToken();
}
}
Then when making a request to Garner's APIs you can use the response of getToken()
from an instance of the GarnerTokenClient
class as your token.
For example,
const garnerTokenClient = new GarnerTokenClient();
fetch('https://api.getgarner.com/providers',
{
method: 'GET',
headers: {'Authorization': `Bearer ${await garnerTokenClient.getToken()}`},
query: ...
},
);
If you were provided an API client id and client secret at account setup rather than a token, please refer to instructions for OAuth2.0 authentication.
Authenticating is done with an JSON Web Token (JWT) provided as a Bearer
token to the Authorization
header.
You will have received a token during account setup.
For example,
curl -G https://api.getgarner.com -H 'Authorization: Bearer <YOUR_API_TOKEN_HERE>'
This endpoint supports two modes of querying. Depending on the query parameter you provide, a different result will be returned.
Query Parameter | Search Mode | Query Type | Result Type |
---|---|---|---|
specialty |
Ranked Search | RankedProviderQuery |
RankedProviderList |
procedure |
Ranked Search | RankedProviderQuery |
RankedProviderList |
name |
Directory Search | DirectorySearchQuery |
DirectorySearchResultList |
npi |
Directory Search | DirectorySearchQuery |
DirectorySearchResultList |
Performs a ranked query for either a specialty or a procedure near a specific Position
. This will return
results in rank-order, where the first Provider
in the list is the most highly recommended based on distance,
quality, cost, and patient reviews. Up to 15 Providers will be returned.
Performs a lookup for a professional by name or NPI near a specific Position; facilities are not currently supported. This will return results by relevance to the query. Providers returned are not necessarily recommended by Garner. Up to 30 Providers will be returned.
Providers resolved successfully
required | Array of objects (RankedProvider) The result list of up to 15 providers (professionals or facilities) for the request. The providers are in rank order. | ||||||||||||||||||||||||||||||||||||||||
Array
|
Invalid request
{- "providers": [
- {
- "id": "p.f3ac4f1a01275ca68e6c932ad4722491",
- "npi": 1231766309,
- "firstName": "Sepideh",
- "lastName": "Baghian",
- "credentials": "MD",
- "gender": "female",
- "specialty": "adult_general_gastroenterologist",
- "procedureCost": 1323.12,
- "referenceCost": 1500,
- "languages": [
- "eng",
- "fas"
], - "metrics": [
- {
- "id": "accurately_diagnoses_gi_issues",
- "value": "very_good"
}, - {
- "id": "performs_safe_colonoscopies",
- "value": "excellent"
}, - {
- "id": "great_patient_outcomes",
- "value": "good"
}
], - "overallScore": 92,
- "reviewStars": 4.5,
- "location": {
- "id": "a515e5d4aad4593f942d8478db993074",
- "name": "Bronx Care Hospital",
- "city": "Bronx",
- "lines": [
- "2739 3rd Ave",
- "# 45"
], - "position": {
- "lat": 40.8144984,
- "lng": -73.920922
}, - "state": "NY",
- "zipCode": "10451"
}, - "hours": [
- {
- "day": 1,
- "open": 480,
- "close": 1020
}, - {
- "day": 2,
- "open": 480,
- "close": 1020
}, - {
- "day": 3,
- "open": 480,
- "close": 1020
}, - {
- "day": 4,
- "open": 480,
- "close": 1020
}, - {
- "day": 5,
- "open": 480,
- "close": 1020
}
], - "phoneNumber": "7189927669",
- "faxNumber": "7189927669",
- "distanceMi": 3.50453352288,
- "availabilityWithinWeeks": 3
}
]
}
{- "locationId": "c52305b90e2a5ce08ce6f0a621acd22f",
- "annotations": [
- {
- "field": "phoneNumber",
- "isCorrect": false,
- "value": 2121126544,
- "correctedValue": 2121126542
}
]
}
{- "count": 1
}
This endpoint returns details about a single professional including quality data for each of the professional's specialties, and directory data for each location at which the professional practices.
Professional found
id required | string^p\.[0-9a-f]+$ Unique identifier for the provider |
npi required | string National Provider Identifier |
first_name required | string First name of the provider |
last_name required | string Last name of the provider |
sex required | string Sex of the provider |
credentials | string Degrees and certifications held by the provider |
review_stars | number [ 1 .. 5 ] Star-rating synthesizing the patient reviews for the provider |
languages | Array of strings <[a-z]{3}> List of languages spoken by the provider. Languages are ISO639-3 codes |
Array of objects (Metric) All metrics associated with all specialties practiced by the provider | |
required | object A map of all specialties practiced by the provider keyed by the specialty identifier |
required | object Map of all office locations of the provider keyed by the location id |
Resource not found
Missing required query parameter
{- "id": "p.f3ac4f1a01275ca68e6c932ad4722491",
- "npi": 1231766309,
- "first_name": "Sepideh",
- "last_name": "Baghian",
- "credentials": "MD",
- "review_stars": 4.78,
- "sex": "female",
- "languages": [
- "eng",
- "fas"
], - "metrics": [
- {
- "id": "accurately_diagnoses_gi_issues",
- "name": "Accurate Diagnosis",
- "value": "very_good"
}, - {
- "id": "performs_safe_colonoscopies",
- "name": "Procedure Safety",
- "value": "excellent"
}, - {
- "id": "great_patient_outcomes",
- "name": "Patient Outcomes",
- "value": "good"
}
], - "specialties": {
- "adult_general_gastroenterologist": {
- "overallScore": 92,
- "locations": [
- {
- "location_id": "ee9dc3bb-2fee-552b-9459-bb9209cb2262",
- "networks": [
- {
- "network_id": "aetna",
- "is_in_network": true,
- "is_top_provider": false
}, - {
- "network_id": "cigna",
- "is_in_network": true,
- "is_top_provider": true
}
]
}, - {
- "location_id": "0372c41d-3a13-5094-9a12-a1e0e1ce5a64",
- "networks": [
- {
- "network_id": "aetna",
- "is_in_network": true,
- "is_top_provider": true
}, - {
- "network_id": "cigna",
- "is_in_network": false,
- "is_top_provider": false
}
]
}
]
}, - "adult_primary_care_physician": {
- "overallScore": 97,
- "locations": [
- {
- "location_id": "ee9dc3bb-2fee-552b-9459-bb9209cb2262",
- "networks": [
- {
- "network_id": "aetna",
- "is_in_network": true,
- "is_top_provider": true
}, - {
- "network_id": "cigna",
- "is_in_network": false,
- "is_top_provider": false
}
]
}, - {
- "location_id": "0372c41d-3a13-5094-9a12-a1e0e1ce5a64",
- "networks": [
- {
- "network_id": "aetna",
- "is_in_network": true,
- "is_top_provider": true
}, - {
- "network_id": "cigna",
- "is_in_network": false,
- "is_top_provider": false
}
]
}
]
}
}, - "locations": {
- "ee9dc3bb-2fee-552b-9459-bb9209cb2262": {
- "lines": [
- "2739 3rd Ave",
- "# 45"
], - "city": "Bronx",
- "state": "NY",
- "zip_code": "10451",
- "position": {
- "lat": 40.8144984,
- "lng": -73.920922
}, - "hours": [
- {
- "day": 1,
- "open": 480,
- "close": 1020
}, - {
- "day": 2,
- "open": 480,
- "close": 1020
}, - {
- "day": 3,
- "open": 480,
- "close": 1020
}, - {
- "day": 4,
- "open": 480,
- "close": 1020
}, - {
- "day": 5,
- "open": 480,
- "close": 1020
}
], - "phone_number": "7189927669",
- "fax_number": "7189927669",
- "name": "Bronx Care Hospital",
- "accepts_new_patients": true,
- "availability_within_weeks": 2
}, - "0372c41d-3a13-5094-9a12-a1e0e1ce5a64": {
- "lines": [
- "1090 Amsterdam Ave"
], - "city": "New York",
- "state": "NY",
- "zip_code": "10025",
- "position": {
- "lat": 40.805222,
- "lng": -73.962477
}, - "hours": [
- {
- "day": 1,
- "open": 480,
- "close": 1020
}, - {
- "day": 4,
- "open": 480,
- "close": 1020
}, - {
- "day": 5,
- "open": 480,
- "close": 1020
}
], - "phone_number": "2125328762",
- "fax_number": "2125328777",
- "name": "Mount Sinai",
- "accepts_new_patients": false,
- "availability_within_weeks": null
}
}
}
This endpoint returns details about a single location of a facility including data for each of the facility's specialties and directory data for the requested location.
Note that one facility ID can be related to many different locations. This endpoint will only show data for one location of a facility, according to the location ID included on the request.
Facility found
Resource not found
Missing required query parameter
{- "id": "f.4e8ca318519553bfaf27010148931d12",
- "npi": 1881670123,
- "organization_name": "Bronx Care Hospital",
- "specialties": {
- "mri_imaging_center": {
- "networks": [
- {
- "network_id": "aetna",
- "is_in_network": true,
- "is_top_provider": false
}, - {
- "network_id": "cigna",
- "is_in_network": true,
- "is_top_provider": true
}
]
}, - "xray_imaging_center": {
- "networks": [
- {
- "network_id": "aetna",
- "is_in_network": true,
- "is_top_provider": true
}, - {
- "network_id": "cigna",
- "is_in_network": false,
- "is_top_provider": false
}
]
}
}, - "location": {
- "location_id": "ee9dc3bb-2fee-552b-9459-bb9209cb2262",
- "lines": [
- "2739 3rd Ave",
- "# 45"
], - "city": "Bronx",
- "state": "NY",
- "zip_code": "10451",
- "position": {
- "lat": 40.8144984,
- "lng": -73.920922
}, - "hours": [
- {
- "day": 1,
- "open": 480,
- "close": 1020
}, - {
- "day": 2,
- "open": 480,
- "close": 1020
}, - {
- "day": 3,
- "open": 480,
- "close": 1020
}, - {
- "day": 4,
- "open": 480,
- "close": 1020
}, - {
- "day": 5,
- "open": 480,
- "close": 1020
}
], - "phone_number": "7189927669",
- "fax_number": "7189927669"
}
}