TestWell Reference API

The Reference API from TestWell, for reference.

GitHub OpenAPI

Operations 4

POST /api/agent/lookup_reference_range Reference range for a biomarker #
POST /api/agent/interpret_results Explain lab results against reviewed reference ranges #
POST /api/agent/convert_units Convert lab units #
POST /api/agent/calculate_free_testosterone Calculate free testosterone (Vermeulen) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/test-well-com:test-well-com-reference-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

test-well-com-reference-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: TestWell Agent Reference API
  version: 1.2.0
  description: 'Cash-pay lab tests without insurance: search TestWell''s catalog, get all-in quotes by state (Quest, Labcorp, BioReference in NY/NJ), find draw sites by ZIP, look up physician-reviewed reference ranges, convert units, calculate free testosterone, compare providers and read guides. Read-only; purchases complete on test-well.com.


    Pricing rule: sticker prices plus one flat $6.00 lab processing fee per order. All endpoints are public, read-only and rate limited (120 requests/minute/IP).'
  contact:
    name: TestWell
    url: https://www.test-well.com/developers
    email: support@test-well.com
  termsOfService: https://www.test-well.com/terms
servers:
- url: https://www.test-well.com
tags:
- name: Reference
paths:
  /api/agent/lookup_reference_range:
    post:
      operationId: lookup_reference_range
      summary: Reference range for a biomarker
      description: Physician-reviewed reference range for a blood test marker (130+ markers), filtered by sex and age when they matter, with what high and low values suggest, retest cadence, how to get tested, cited sources and the review date. Educational; the user's own report range takes precedence.
      tags:
      - Reference
      x-openai-isConsequential: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                marker:
                  type: string
                  minLength: 1
                  maxLength: 80
                  description: Marker name or alias, e.g. 'TSH', 'ferritin', 'HbA1c', 'LDL'
                sex:
                  type: string
                  enum:
                  - male
                  - female
                age:
                  type: integer
                  minimum: 0
                  maximum: 120
                pregnancy:
                  type: boolean
                postmenopausal:
                  type: boolean
              required:
              - marker
            examples:
              example1:
                summary: Sex-specific ferritin band
                value:
                  marker: ferritin
                  sex: female
                  age: 34
      responses:
        '200':
          description: Tool result
          content:
            application/json:
              schema:
                type: object
                required:
                - tool
                - result
                properties:
                  tool:
                    type: string
                    enum:
                    - lookup_reference_range
                  result:
                    type: object
                    properties:
                      found:
                        type: boolean
                      marker:
                        type: string
                      aliases:
                        type: array
                        items:
                          type: string
                      category:
                        type: string
                      units:
                        type: array
                        items:
                          type: string
                      measures:
                        type: string
                      filteredToQuery:
                        type: boolean
                      ranges:
                        type: array
                        items:
                          type: object
                          properties:
                            qualifier:
                              description: Who the band applies to, e.g. 'Female, age 18+'
                              type: string
                            range:
                              type: string
                            min:
                              type: number
                            max:
                              type: number
                            unit:
                              type: string
                          additionalProperties: {}
                      highSuggests:
                        anyOf:
                        - type: string
                        - type: 'null'
                      lowSuggests:
                        anyOf:
                        - type: string
                        - type: 'null'
                      retest:
                        anyOf:
                        - type: string
                        - type: 'null'
                      howToTest:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            kind:
                              type: string
                            price:
                              type: number
                              description: USD
                            url:
                              type: string
                              description: Absolute https URL on test-well.com
                          additionalProperties: {}
                      citations:
                        type: array
                        items:
                          type: object
                          properties:
                            label:
                              type: string
                            url:
                              type: string
                          additionalProperties: {}
                      suggestions:
                        type: array
                        items:
                          type: string
                      browse:
                        type: string
                    additionalProperties: {}
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
  /api/agent/interpret_results:
    post:
      operationId: interpret_results
      summary: Explain lab results against reviewed reference ranges
      description: Flag each pasted lab value as low / normal / high against TestWell's physician-reviewed reference catalog (130+ markers; sex- and age-specific bands where they exist), with the reviewed 'what high/low suggests' copy, retest guidance, cited sources and links to the marker's page and, where one…
      tags:
      - Reference
      x-openai-isConsequential: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                values:
                  minItems: 1
                  maxItems: 40
                  type: array
                  items:
                    type: object
                    properties:
                      marker:
                        type: string
                        minLength: 1
                        maxLength: 80
                      value:
                        type: number
                      unit:
                        type: string
                        maxLength: 20
                    required:
                    - marker
                    - value
                  description: Results to explain, e.g. [{marker:'TSH', value:5.2, unit:'mIU/L'}, {marker:'ferritin', value:12}]
                sex:
                  type: string
                  enum:
                  - male
                  - female
                age:
                  type: integer
                  minimum: 0
                  maximum: 120
                pregnancy:
                  type: boolean
                postmenopausal:
                  type: boolean
              required:
              - values
            examples:
              example1:
                summary: Two results flagged against sex-specific bands
                value:
                  values:
                  - marker: TSH
                    value: 5.2
                    unit: mIU/L
                  - marker: ferritin
                    value: 12
                    unit: ng/mL
                  sex: female
                  age: 34
      responses:
        '200':
          description: Tool result
          content:
            application/json:
              schema:
                type: object
                required:
                - tool
                - result
                properties:
                  tool:
                    type: string
                    enum:
                    - interpret_results
                  result:
                    type: object
                    properties:
                      results:
                        type: array
                        items:
                          type: object
                          properties:
                            input:
                              type: object
                              properties:
                                marker:
                                  type: string
                                value:
                                  type: number
                                unit:
                                  anyOf:
                                  - type: string
                                  - type: 'null'
                              additionalProperties: {}
                            found:
                              type: boolean
                            marker:
                              anyOf:
                              - type: string
                              - type: 'null'
                            slug:
                              anyOf:
                              - type: string
                              - type: 'null'
                            flag:
                              type: string
                              enum:
                              - low
                              - normal
                              - high
                              - unknown
                            range:
                              anyOf:
                              - type: object
                                properties:
                                  qualifier:
                                    type: string
                                  min:
                                    type: number
                                  max:
                                    type: number
                                  unit:
                                    type: string
                                  text:
                                    type: string
                                additionalProperties: {}
                              - type: 'null'
                            deviationPct:
                              description: Distance outside the band as % of band width
                              anyOf:
                              - type: number
                              - type: 'null'
                            unitMismatch:
                              type: boolean
                            suggests:
                              description: Reviewed copy for this direction
                              anyOf:
                              - type: string
                              - type: 'null'
                            retest:
                              anyOf:
                              - type: string
                              - type: 'null'
                            citations:
                              type: array
                              items:
                                type: object
                                properties:
                                  label:
                                    type: string
                                  url:
                                    type: string
                                additionalProperties: {}
                            links:
                              type: object
                              properties:
                                biomarker:
                                  anyOf:
                                  - type: string
                                  - type: 'null'
                                interpretation:
                                  anyOf:
                                  - type: string
                                  - type: 'null'
                                orderTest:
                                  anyOf:
                                  - type: string
                                  - type: 'null'
                              additionalProperties: {}
                            suggestions:
                              type: array
                              items:
                                type: string
                          additionalProperties: {}
                      summary:
                        type: object
                        properties:
                          total:
                            type: number
                          matched:
                            type: number
                          high:
                            type: number
                          low:
                            type: number
                          normal:
                            type: number
                          unknown:
                            type: number
                        additionalProperties: {}
                      disclaimer:
                        type: string
                      reviewed:
                        type: object
                        properties:
                          catalog:
                            anyOf:
                            - type: string
                            - type: 'null'
                          reviewer:
                            type: string
                        additionalProperties: {}
                    additionalProperties: {}
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
  /api/agent/convert_units:
    post:
      operationId: convert_units
      summary: Convert lab units
      description: Convert a lab value between US conventional and SI units for 30 common analytes (glucose, cholesterol, testosterone, vitamin D, …) using published factors; hemoglobin A1c uses the NGSP↔IFCC master equation and also returns estimated average glucose.
      tags:
      - Reference
      x-openai-isConsequential: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                analyte:
                  type: string
                  minLength: 1
                  maxLength: 60
                  description: Analyte slug or name, e.g. 'glucose', 'total-cholesterol', 'testosterone', 'vitamin-d', 'a1c'
                value:
                  type: number
                  description: The numeric value to convert
                direction:
                  description: Default toSI (US → SI)
                  type: string
                  enum:
                  - toSI
                  - toConventional
              required:
              - analyte
              - value
            examples:
              example1:
                summary: 100 mg/dL → 5.55 mmol/L
                value:
                  analyte: glucose
                  value: 100
              example2:
                summary: 5.7% → 39 mmol/mol, eAG 117 mg/dL
                value:
                  analyte: a1c
                  value: 5.7
      responses:
        '200':
          description: Tool result
          content:
            application/json:
              schema:
                type: object
                required:
                - tool
                - result
                properties:
                  tool:
                    type: string
                    enum:
                    - convert_units
                  result:
                    type: object
                    properties:
                      analyte:
                        type: string
                      input:
                        type: object
                        properties:
                          value:
                            type: number
                          unit:
                            type: string
                        additionalProperties: {}
                      output:
                        type: object
                        properties:
                          value:
                            type: number
                          unit:
                            type: string
                        additionalProperties: {}
                      factor:
                        type: number
                      method:
                        type: string
                      estimatedAverageGlucose:
                        type: object
                        properties:
                          value:
                            type: number
                          unit:
                            type: string
                        additionalProperties: {}
                      note:
                        anyOf:
                        - type: string
                        - type: 'null'
                      biomarkerUrl:
                        anyOf:
                        - type: string
                        - type: 'null'
                      error:
                        type: string
                    additionalProperties: {}
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
  /api/agent/calculate_free_testosterone:
    post:
      operationId: calculate_free_testosterone
      summary: Calculate free testosterone (Vermeulen)
      description: Calculate free and bioavailable testosterone from total testosterone, SHBG and albumin using the Vermeulen (1999) mass-action equation — the method behind lab-reported 'calculated free testosterone'. Educational; not a diagnosis.
      tags:
      - Reference
      x-openai-isConsequential: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                totalT:
                  type: number
                  exclusiveMinimum: 0
                  description: Total testosterone
                totalTUnit:
                  description: Default ng/dL
                  type: string
                  enum:
                  - ng/dL
                  - nmol/L
                shbg:
                  type: number
                  exclusiveMinimum: 0
                  description: SHBG in nmol/L
                albuminGdL:
                  description: Albumin in g/dL (default 4.3)
                  type: number
                  exclusiveMinimum: 0
                  maximum: 6
              required:
              - totalT
              - shbg
            examples:
              example1:
                summary: Typical male values
                value:
                  totalT: 450
                  shbg: 35
      responses:
        '200':
          description: Tool result
          content:
            application/json:
              schema:
                type: object
                required:
                - tool
                - result
                properties:
                  tool:
                    type: string
                    enum:
                    - calculate_free_testosterone
                  result:
                    type: object
                    properties:
                      inputs:
                        type: object
                        properties:
                          totalT:
                            type: number
                          totalTUnit:
                            type: string
                          shbg:
                            type: number
                          albuminGdL:
                            type: number
                        additionalProperties: {}
                      freeTestosterone:
                        type: object
                        properties:
                          pgmL:
                            type: number
                          ngdL:
                            type: number
                          nmolL:
                            type: number
                        additionalProperties: {}
                      bioavailableTestosterone:
                        type: object
                        properties:
                          ngdL:
                            type: number
                          nmolL:
                            type: number
                        additionalProperties: {}
                      freePercent:
                        type: number
                      method:
                        type: string
                      tests:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            url:
                              type: string
                          additionalProperties: {}
                      toolUrl:
                        type: string
                    additionalProperties: {}
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolError'
components:
  schemas:
    ToolError:
      type: object
      properties:
        error:
          type: string
        issues:
          type: array
          items:
            type: object
            additionalProperties: true
      required:
      - error
externalDocs:
  url: https://www.test-well.com/developers
  description: Developer documentation
x-mcp:
  url: https://www.test-well.com/mcp
  serverCard: https://www.test-well.com/.well-known/mcp/server-card.json