Look up payer IDs in Google Sheets

Sep 3, 2025

Guide

You can turn payer names into payer IDs (or the reverse) in Google Sheets using the Search Payers API endpoint. This guide tells you how.

Tip: If you just want a full list of Stedi’s payers in a spreadsheet-friendly format, you can download the latest payer CSV from the Stedi Payer Network or use the List Payers CSV endpoint.

Requirements

To use the Search Payers API endpoint, you need a paid Stedi developer account. To try it out free, request a trial.

Step 1. Create a production API key

  1. Log in to Stedi.

  2. Click your account name at the top right of the screen.

  3. Select API Keys.

  4. Click Generate new API Key.

  5. Enter a name for your API key.

  6. Select Production mode.

  7. Click Generate. Stedi generates an API key and allows you to copy it.

If you lose the API key, delete it and create a new one.

Step 2. Open Google Sheets

In your Google Sheet spreadsheet, place your payer names or payer IDs in column A. You can mix them if desired. For example:



How this may look in your spreadsheet:

Google Sheets example

Step 3. Create the script

  1. In the Google Sheets menu, click Extensions > Apps Script.

  2. Delete what’s in the editor.

  3. Paste in the following code. Replace YOUR_STEDI_API_KEY with your Stedi API key.

    /**
     * Returns the payer name and primary payer ID from Stedi's Payer Search API.
     * Usage: =STEDI_PAYER_INFO(A2)
     * Output: [[payer name, primary payer ID]]
     */
    function STEDI_PAYER_INFO(query) {
      if (!query) return ["", ""];
      var apiKey = "YOUR_STEDI_API_KEY"; // Replace with your Stedi API key
      var encodedQuery = encodeURIComponent(query);
      var url = "https://healthcare.us.stedi.com/2024-04-01/payers/search?query=" + encodedQuery;
      var options = {
        "method": "get",
        "headers": { "Authorization": apiKey },
        "muteHttpExceptions": true
      };
      try {
        var response = UrlFetchApp.fetch(url, options);
        var result = JSON.parse(response.getContentText());
        if (
          result.items &&
          result.items.length > 0 &&
          result.items[0].payer &&
          result.items[0].payer.displayName &&
          result.items[0].payer.primaryPayerId
        ) {
          return [[
            result.items[0].payer.displayName,
            result.items[0].payer.primaryPayerId
          ]];
        } else {
          return [["No match found", ""]];
        }
      } catch (e) {
        return [["Error: " + e.message, ""]];
      }
    }
  4. Click the Save project to Drive icon or press Ctrl + S.

The script creates an =STEDI_PAYER_INFO() formula that outputs the payer name and primary payer ID from the Search Payers API endpoint.

Step 4. Use the Google Sheets formula

In your Google Sheets spreadsheet, use the =STEDI_PAYER_INFO() formula to get the payer name and primary payer ID for each value in column A. For example:

Google Sheets example

The search supports fuzzy matching. The formula returns the closest match available.

Note: The payer names returned by the Search Payers API endpoint are intended for routing transactions – not for display in patient-facing UIs. If you need a patient-facing name, build your own list and map the names to Stedi payer IDs.

Get started

The Payers API is available on Stedi’s paid developer plan.

To try it out, request a free trial. Most teams are up and running in less than a day.

Share

Twitter
LinkedIn

Get started with Stedi

Get started with Stedi

Automate healthcare transactions with developer-friendly APIs that support thousands of payers. Contact us to learn more and speak to the team.

Get updates on what’s new at Stedi

Get updates on what’s new at Stedi

Get updates on what’s new at Stedi

Get updates on what’s new at Stedi

Backed by

Stedi is a registered trademark of Stedi, Inc. All names, logos, and brands of third parties listed on our site are trademarks of their respective owners (including “X12”, which is a trademark of X12 Incorporated). Stedi, Inc. and its products and services are not endorsed by, sponsored by, or affiliated with these third parties. Our use of these names, logos, and brands is for identification purposes only, and does not imply any such endorsement, sponsorship, or affiliation.

Get updates on what’s new at Stedi

Backed by

Stedi is a registered trademark of Stedi, Inc. All names, logos, and brands of third parties listed on our site are trademarks of their respective owners (including “X12”, which is a trademark of X12 Incorporated). Stedi, Inc. and its products and services are not endorsed by, sponsored by, or affiliated with these third parties. Our use of these names, logos, and brands is for identification purposes only, and does not imply any such endorsement, sponsorship, or affiliation.

Get updates on what’s new at Stedi

Backed by

Stedi is a registered trademark of Stedi, Inc. All names, logos, and brands of third parties listed on our site are trademarks of their respective owners (including “X12”, which is a trademark of X12 Incorporated). Stedi, Inc. and its products and services are not endorsed by, sponsored by, or affiliated with these third parties. Our use of these names, logos, and brands is for identification purposes only, and does not imply any such endorsement, sponsorship, or affiliation.