Using the IQ Score API in Excel

Learn how to load your IQ Score API data into Microsoft Excel with Power Query and refresh it whenever you need updated scores.

Using the IQ Score API in Excel
IQ Score API in Excel

Using the IQ Score API in Excel

Microsoft Excel can connect to the Income Quality Score API and pull IQ Score data straight into a worksheet using a built-in feature called Power Query. Once it is set up, you never have to copy and paste scores by hand.

After the one-time setup below, you refresh your data at any time with Excel's Refresh All command. Each refresh retrieves the IQ Score data that is currently available to your membership.

Programmatic API access is part of the IQ Score Pro membership.

Note on what this data is. IQ Score classifications (Friend, Question Mark, Foe) are research and quality signals about income assets. They are not personal investment advice, trade signals, or buy, hold, or sell recommendations. See the disclaimer at the end of this page.

1. Before you start

You will need:

  1. An active membership with API access.
  2. Your personal IQ Score API key.
  3. A current version of Microsoft Excel that includes Power Query (Excel for Windows and Microsoft 365 include it built in).
  4. A working internet connection.

Your personal API key is issued to your account and is available from your member API page:

Sign in as a member, open that page, and copy your key. Your key looks like iqs_live_ followed by a long string of letters and numbers.

Keep your key private. Your API key is personal. Do not share a workbook that contains your API key. Anyone who can inspect the workbook's Power Query settings may be able to view it.

2. What the API returns

The IQ Score API gives you the latest published monthly snapshot of IQ Score data for the tickers you ask about. You send a list of tickers; the API returns one row of data for each.

  • Base address: https://api.incomequalityscore.com
  • Endpoint used in this guide: POST /v1/assets/batch
  • Authentication: a request header named X-API-Key set to your personal key

Good to know before you build the query:

  • You request scores by ticker. There is no single call that downloads the entire IQ Score universe — you provide the tickers you care about, up to 100 per request.
  • The API returns the most recently published snapshot. Scores are refreshed monthly, so refreshing more often than that will usually return the same numbers.
  • Every row tells you exactly which month it represents, so you always know how current the data is.

3. Connect Excel to the IQ Score API

Because the API needs a custom X-API-Key header, the most reliable method is a Blank Query with a short piece of Power Query code (called "M"). The From Web dialog cannot reliably attach this header, so use the steps below.

  1. Open a blank workbook.
  2. Go to the Data tab on the ribbon.
  3. Select Get Data.
  4. Choose From Other Sources → Blank Query.
  5. In the Power Query Editor, select Home → Advanced Editor.
  6. Delete whatever is in the editor and paste the query from the next section.
  7. Replace PASTE_YOUR_API_KEY_HERE with your own key, and edit the ticker list to the securities you want.
  8. Select Done. If Excel asks about credentials or privacy for the data source, choose Anonymous (your key is already sent in the header) and, if prompted, allow the connection.
  9. Power Query will show your data as a table.
  10. Select Home → Close & Load to send the table to a worksheet.

4. The Power Query example

Paste this into the Advanced Editor (step 6 above). Replace the key and the ticker list with your own.

let
    // 1. Your personal IQ Score API key (from incomequalityscore.com/iq-score-api/)
    ApiKey = "PASTE_YOUR_API_KEY_HERE",

    // 2. The tickers you want to score — up to 100 per request
    Tickers = {"ARCC", "UTG", "GOF", "XYLD", "ECC"},

    // 3. Build the JSON request body: { "tickers": [ ... ] }
    RequestBody = Json.FromValue([ tickers = Tickers ]),

    // 4. Call the batch endpoint. Sending Content makes this a POST.
    RawResponse = Web.Contents(
        "https://api.incomequalityscore.com/v1/assets/batch",
        [
            Headers = [
                #"X-API-Key"    = ApiKey,
                #"Content-Type" = "application/json",
                #"Accept"       = "application/json"
            ],
            Content = RequestBody
        ]
    ),

    // 5. Parse the JSON and take the "results" list
    Parsed  = Json.Document(RawResponse),
    Results = Parsed[results],

    // 6. Turn the list of records into a table
    AsTable = Table.FromList(Results, Splitter.SplitByNothing(), null, null, ExtraValues.Error),

    // 7. Expand the record fields into columns
    Expanded = Table.ExpandRecordColumn(
        AsTable,
        "Column1",
        {"ticker", "name", "asset_type", "iq_score", "classification",
         "confidence", "score_as_of", "snapshot_id", "methodology_version", "availability"},
        {"Ticker", "Name", "Asset Class", "IQ Score", "Classification",
         "Confidence", "Score As Of", "Snapshot", "Methodology", "Availability"}
    )
in
    Expanded

A few notes on the query:

  • The #"X-API-Key" header carries your authentication. The quotes-with-# form is how Power Query writes a name that contains a dash.
  • Because a Content value is supplied, Excel automatically sends this as a POST request — you do not set the method yourself.
  • The response's top-level field is called results. Step 5 reads that list, and step 7 opens each record into its own columns.

5. A safer setup with a Power Query parameter

Putting the key directly in the query works, but a parameter keeps it in one place so you only edit it once.

  1. In the Power Query Editor, select Home → Manage Parameters → New Parameter.
  2. Name it exactly IQScoreApiKey.
  3. Set the type to Text and paste your key as the Current Value.
  4. Select OK.

Then open the Advanced Editor and change the key line so it reads from the parameter instead of a literal:

    // Read the key from the IQScoreApiKey parameter instead of typing it here
    ApiKey = IQScoreApiKey,

Leave the rest of the query unchanged.

A parameter makes the workbook easier to maintain, but it does not hide the secret. Anyone who opens the workbook's queries and parameters can still read the key. Treat any workbook that contains your key as confidential.

6. Understanding the imported columns

Each row describes one ticker. These are the fields the API returns:

Column API field What it means
Ticker ticker The security symbol you requested.
Name name The security's name (blank if not available).
Asset Class asset_type One of CEF, ETF, BDC, REIT, or blank.
IQ Score iq_score The IQ Score from 0–100 (blank when a score is not available).
Classification classification friend, question_mark, foe, or insufficient.
Confidence confidence high, medium, low, or blank.
Score As Of score_as_of The as-of date of the snapshot (for example 2026-06-30).
Snapshot snapshot_id The snapshot month the row comes from, as YYYY-MM.
Methodology methodology_version The methodology version behind the score (for example iq-4class-v1).
Availability availability Why a score is or is not present (see below).

Reading the availability column. Not every ticker has a published score. This column tells you why:

Value Meaning
available A published IQ Score is present.
score_unavailable The security is covered, but there is not enough history yet for a score.
not_covered A recognized security, but not in the published snapshot.
not_found The symbol was not recognized.
invalid_ticker The text you sent is not a valid ticker format.

Which month am I looking at? The API always returns the most recently published snapshot. The Snapshot (snapshot_id) and Score As Of (score_as_of) columns tell you exactly which month each row represents, so you never have to guess. You do not choose a tier or a delay by hand — the API serves the latest published month.


7. Filtering the data

Once the table is in Excel, the easiest way to filter is with Excel's own tools:

  • Turn on AutoFilter (Data → Filter) and filter the Classification column to friend, the Asset Class column to CEF, and so on.
  • Sort by IQ Score to see the highest-scoring names at the top.
  • Hide any rows where Availability is not available.

The API itself keeps requests simple. There are only two things you control on the server side:

  1. Which tickers you request — edit the Tickers list in the query (up to 100).
  2. Which month you pin (optional) — by default you get the latest snapshot. To pin a specific past month, add a month value to the request body in step 3:
    // Pin a specific published month instead of the latest one
    RequestBody = Json.FromValue([ tickers = Tickers, month = "2026-06" ]),

The month must be written as YYYY-MM. There are no other server-side filters — everything else (by classification, by asset class, by score) is done with normal Excel filtering.


8. Refreshing the workbook

To pull the newest data:

  • Refresh everything: Data tab → Refresh All.
  • Refresh one query: right-click the query's table (or the query in the Queries & Connections pane) → Refresh.
  • Refresh on open: right-click the query → Properties → tick Refresh data when opening the file.
  • Inspect a query: open Queries & Connections (Data tab) to see each query and its last refresh time.

Keep in mind:

  • The workbook needs internet access to refresh.
  • IQ Score snapshots update monthly, so there is rarely a reason to refresh more than a few times a day. Frequent refreshing returns the same numbers and wastes bandwidth.
  • If your API key is ever replaced or revoked, update the new key in the query (or in the IQScoreApiKey parameter) — an old key will stop working.

9. Troubleshooting

403 (Forbidden) — the request was rejected. Cause: a missing, mistyped, expired, or revoked key, or API access is not enabled for your account. Action: re-copy your key from your API page, check for stray spaces, and make sure the X-API-Key header value matches exactly.

400 (Bad Request) — the request was not valid. Cause: an empty ticker list, more than 100 tickers, or a month that is not written as YYYY-MM. Action: fix the Tickers list or the month value in the query and refresh again.

404 (Not Found). Cause: no published snapshot is available yet, or the address in the query was edited incorrectly. Action: confirm the URL is exactly https://api.incomequalityscore.com/v1/assets/batch.

A 422 or a body error. Cause: the JSON request body was malformed (for example if the query was edited by hand). Action: re-paste the query from Section 4 and only change the key and the ticker list.

Too many requests / server busy. Action: wait a moment and refresh again. Because scores only change monthly, there is no need to refresh frequently.

500 (server error). Cause: a temporary problem on the server. Action: wait and try the refresh again later.

Empty results, or rows with no score. This usually is not an error. Check the Availability column: not_covered, not_found, score_unavailable, or invalid_ticker explain why a particular ticker has no score. Correct any misspelled symbols in your Tickers list.

Power Query privacy-level error, or Formula.Firewall. Cause: Excel is unsure how to combine data sources. Action: go to Data → Get Data → Query Options → Privacy, and set the privacy level for this file (Public or Organizational), or choose to ignore privacy levels for this workbook. Keeping the key inline or in a single parameter (as in this guide) avoids most firewall issues.

Excel keeps asking for credentials, or uses the wrong ones. Action: go to Data → Get Data → Data Source Settings, select the api.incomequalityscore.com source, choose Edit Permissions → Clear Permissions, then refresh and select Anonymous when prompted. Your key travels in the header, so no username or password is needed.

Columns stop expanding after a refresh. Cause: the response format changed and the expand step no longer matches. Action: open the Advanced Editor, and re-run the Expand step (step 7) so it lists the current fields.

If a problem persists, do not attempt to work around access restrictions. Contact IQ Score support instead.


10. Security and sharing your workbook

  • Never publish or post a workbook that contains your API key.
  • Remove the key before sending a workbook to anyone. Clear the ApiKey line or the IQScoreApiKey parameter first.
  • Each member should use their own key. Do not share one key across people.
  • Storing the key in a hidden worksheet is not secure. Hidden sheets are trivial to unhide.
  • If your key is ever exposed, it can be revoked and a new one issued. Contact IQ Score to revoke the old key and reissue a replacement, then update the new key in your workbook.

11. Scope and disclaimer

IQ Score API data is provided for research and informational purposes only. It is not personal investment advice, and IQ Score classifications are not buy, hold, or sell recommendations.

The availability and freshness of the data depend on your membership access level. Scores are published monthly and may change from one snapshot to the next.

Please review our full Terms of Use and Investment Disclaimer.