Garner Health API (v1.11.0)

Download OpenAPI specification:Download

License: Commercial

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.

Authentication:

OAuth2.0

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>'

Managing the access token

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: ...
  },
);

Legacy token

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>'

Get a list of providers near a position

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

Ranked Search (Primary)

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.

Directory Search (Secondary)

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.

SecurityApiToken
Request
query Parameters
RankedProviderQuery (object) or DirectorySearchQuery (object)
header Parameters
Accept-Version
required
integer

The API major version.

Value: 1
Request-ID
string

Correlation ID to be provided on responses

Responses
200

Providers resolved successfully

Response Schema: application/json
One of:
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
id
required
string

Unique identifier for the provider

npi
string

National Provider Identifier

firstName
string

First name of the provider. Only returned if provider is a professional rather than a facility

lastName
string

Last name of the provider. Only returned if provider is a professional rather than a facility

credentials
string

Degrees and certifications held by the provider. Only returned if provider is a professional rather than a facility

gender
string (Gender)

Gender. Only returned if provider is a professional rather than a facility

Enum: "male" "female"
specialty
required
string

The specialty identifier for the provider

organizationName
string

Name of the facility. Only returned if provider is a facility rather than a professional

procedureCost
number

Estimate of the cost of the queried procedure in USD. Omitted if querying on specialty. This field is only available through the Core Plus API.

referenceCost
number

Reference cost of the queried procedure in USD. Omitted if querying on specialty. This field is only available through the Core Plus API.

languages
Array of strings <[a-z]{3}>

List of languages spoken by the provider. Languages are ISO639-3 codes. Only returned if provider is a professional rather than a facility,

Array of objects

Relevant metrics for the query. Will be repeated for each provider ranked for ease of comparison.

overallScore
integer [ 0 .. 100 ]

Score for the provider taking into account overall quality and cost

reviewStars
number [ 1 .. 5 ]

Star-rating synthesizing the patient reviews for the provider

required
object (Location)

The office location of a provider

Array of objects (WorkingHours)
phoneNumber
required
string <[0-9]{10}>

10-digit phone number

faxNumber
string <[0-9]{10}>

10-digit fax number

distanceMi
required
number

The driving distance to the location in miles

availabilityWithinWeeks
number

The number of weeks out a provider is scheduling new patients, if known

422

Invalid request

get/providers
Request samples
Response samples
application/json
{
  • "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": [
        • {
          },
        • {
          },
        • {
          }
        ],
      • "overallScore": 92,
      • "reviewStars": 4.5,
      • "location": {
        • "id": "a515e5d4aad4593f942d8478db993074",
        • "name": "Bronx Care Hospital",
        • "city": "Bronx",
        • "lines": [
          ],
        • "position": {
          },
        • "state": "NY",
        • "zipCode": "10451"
        },
      • "hours": [
        • {
          },
        • {
          },
        • {
          },
        • {
          },
        • {
          }
        ],
      • "phoneNumber": "7189927669",
      • "faxNumber": "7189927669",
      • "distanceMi": 3.50453352288,
      • "availabilityWithinWeeks": 3
      }
    ]
}

Annotate a Provider record for accuracy

SecurityApiToken
Request
path Parameters
provider_id
required
string

The Garner ID for the provider.

Example: p.f3ac4f1a01275ca68e6c932ad4722491
header Parameters
Accept-Version
required
integer

The API major version.

Value: 1
Request Body schema: application/json
locationId
required
string

id of the provider's location

required
Array of objects (Annotation)

List of annotations for the provider record

Responses
200

Created annotations

Response Schema: application/json
count
required
number

Number of annotations created

422

Annotation field not supported

post/provider-annotations/{provider_id}
Request samples
application/json
{
  • "locationId": "c52305b90e2a5ce08ce6f0a621acd22f",
  • "annotations": [
    • {
      • "field": "phoneNumber",
      • "isCorrect": false,
      • "value": 2121126544,
      • "correctedValue": 2121126542
      }
    ]
}
Response samples
application/json
{
  • "count": 1
}

Get details about a professional

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.

SecurityApiToken
Request
path Parameters
professional_id
required
string^p\.[0-9a-f]+$

The Garner ID for the professional. It will always have the prefix p.

Example: p.f3ac4f1a01275ca68e6c932ad4722491
query Parameters
network_id
required
Array of strings

The list of networks to include on the professional response.

header Parameters
Accept-Version
required
integer

The API major version.

Value: 1
Responses
200

Professional found

Response Schema: application/json
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

Enum: "female" "male"
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

404

Resource not found

422

Missing required query parameter

get/professionals/{professional_id}
Request samples
Response samples
application/json
{
  • "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": [
        • {
          },
        • {
          }
        ]
      },
    • "adult_primary_care_physician": {
      • "overallScore": 97,
      • "locations": [
        • {
          },
        • {
          }
        ]
      }
    },
  • "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": [
        • {
          },
        • {
          },
        • {
          },
        • {
          },
        • {
          }
        ],
      • "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": [
        • {
          },
        • {
          },
        • {
          }
        ],
      • "phone_number": "2125328762",
      • "fax_number": "2125328777",
      • "name": "Mount Sinai",
      • "accepts_new_patients": false,
      • "availability_within_weeks": null
      }
    }
}

Get details about a facility

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.

SecurityApiToken
Request
path Parameters
facility_id
required
string^f\.[0-9a-f]+$

The Garner ID for the facility. It will always have the prefix f.

Example: f.l3ac4f1a01275ca68e6c932ad4722491
query Parameters
location_id
required
string

The Garner location ID for a specific location of the requested facility ID.

network_id
required
Array of strings

The list of networks to include on the facility response.

header Parameters
Accept-Version
required
integer

The API major version.

Value: 1
Responses
200

Facility found

Response Schema: application/json
id
required
string^f\.[0-9a-f]+$

Unique identifier for the provider

npi
string

National Provider Identifier

organization_name
required
string

Name of the facility

required
object

A map of all the facility location's specialties keyed by the specialty identifier

required
object (FacilityLocation)

The address of the facility

404

Resource not found

422

Missing required query parameter

get/facilities/{facility_id}
Request samples
Response samples
application/json
{
  • "id": "f.4e8ca318519553bfaf27010148931d12",
  • "npi": 1881670123,
  • "organization_name": "Bronx Care Hospital",
  • "specialties": {
    • "mri_imaging_center": {
      • "networks": [
        • {
          },
        • {
          }
        ]
      },
    • "xray_imaging_center": {
      • "networks": [
        • {
          },
        • {
          }
        ]
      }
    },
  • "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"
    }
}