Export · Microsoft Excel

Keep NowMetrix metrics in Microsoft Excel

Use Power Query to import NowMetrix data into a regular Excel table. No plug-in or programming experience is required: create an API key, paste the prepared query, and load the result.

How the connection works

Excel requests the selected data directly from the NowMetrix REST API:

NowMetrix REST API → Power Query → Excel table → charts, formulas, or PivotTables

The example in this guide imports the last 30 available daily rows from /v1/overview. Each row contains a date, tracker, tracker timezone, pageviews, and visits. Refreshing the query replaces the imported table with the latest API response.

This is an imported reporting dataset, not a realtime stream. An hourly or daily refresh is normally sufficient. For a continuously updated report, consider Microsoft Power BI.

Before you start

You need:

  • a NowMetrix account with REST API access,
  • access to the tracker you want to export,
  • Microsoft Excel with Power Query, and
  • permission to create and refresh external data connections.

On Windows, Power Query is available under Data → Get Data. On current Microsoft 365 versions for macOS, use Data → Get Data (Power Query). Menu names can differ slightly by Excel version and language.

If you cannot find the Power Query Editor on a Mac, update Microsoft 365 first. Microsoft documents the current Mac workflow in its Power Query for Excel for Mac guide.

1. Create a dedicated API key

  1. Sign in to NowMetrix.
  2. Open Settings → API.
  3. Create a new key with a clear label, for example Microsoft Excel.
  4. Copy the complete key immediately. It is shown only once.
  5. Note the tracker ID for the website you want to export.
Placeholder Replace with Example
nm_YOUR_KEY Your complete NowMetrix API key nm_…
TRACKER_ID The tracker ID to export news-example-com
Treat the API key like a password. Do not send it by email or chat, place it in an Excel cell, or include it in screenshots. Use a separate key so it can be revoked without affecting other integrations.

2. Open a blank Power Query

Excel for Windows

  1. Create a new workbook or open the workbook that should contain the export.
  2. Select Data → Get Data → From Other Sources → Blank Query.
  3. In the Power Query Editor, select Home → Advanced Editor.

Excel for macOS

  1. Create a new workbook or open the target workbook.
  2. Select Data → Get Data (Power Query) → Launch Power Query Editor.
  3. Create a Blank Query, then open Home → Advanced Editor.

3. Paste the prepared query

  1. Remove the existing content from the Advanced Editor.
  2. Paste the complete query below.
  3. Replace nm_YOUR_KEY and TRACKER_ID in the first two lines.
  4. Leave the quotation marks around both values.
  5. Select Done.
let
    ApiKey = "nm_YOUR_KEY",
    TrackerId = "TRACKER_ID",

    Response = Json.Document(
        Web.Contents(
            "https://api.nowmetrix.com",
            [
                RelativePath = "v1/overview",
                Query = [
                    site = TrackerId,
                    days = "30"
                ],
                Headers = [
                    Authorization = "Bearer " & ApiKey,
                    Accept = "application/json"
                ],
                Timeout = #duration(0, 0, 0, 30)
            ]
        )
    ),

    DailyRows = if List.IsEmpty(Response[daily]) then
        #table(type table [date = text, pageviews = Int64.Type, visits = Int64.Type], {})
    else
        Table.FromRecords(Response[daily]),

    AddTracker = Table.AddColumn(
        DailyRows,
        "tracker",
        each Response[site],
        type text
    ),
    AddTimezone = Table.AddColumn(
        AddTracker,
        "timezone",
        each Response[timezone],
        type text
    ),
    ReorderedColumns = Table.ReorderColumns(
        AddTimezone,
        {"date", "tracker", "timezone", "pageviews", "visits"}
    ),
    TypedColumns = Table.TransformColumnTypes(
        ReorderedColumns,
        {
            {"date", type date},
            {"tracker", type text},
            {"timezone", type text},
            {"pageviews", Int64.Type},
            {"visits", Int64.Type}
        }
    )
in
    TypedColumns

The fixed base URL plus RelativePath and Query keep the address readable and prevent the API key from appearing in the URL. The key is sent only in the HTTPS Authorization header.

4. Confirm the data source settings

Excel may ask how it should connect to https://api.nowmetrix.com.

  1. Choose Anonymous.
  2. Apply the setting to https://api.nowmetrix.com.
  3. Select Connect.
  4. If asked for a privacy level, select the level required by your organization. Private provides the strictest separation from other data sources.
Anonymous only describes Excel's built-in credential method. The request is not anonymous to NowMetrix: the query authenticates with your API key in the Bearer header.

5. Load and verify the table

  1. Wait until the Power Query preview displays five columns.
  2. Optionally rename the query to NowMetrix Daily.
  3. Select Home → Close & Load.
  4. Excel creates a worksheet table with the imported rows.
date tracker timezone pageviews visits
2026-08-22 TRACKER_ID Europe/Zurich 81,240 53,210
2026-08-23 TRACKER_ID Europe/Zurich 77,480 50,195

You can now create formulas, charts, PivotTables, or additional worksheets that reference this table. Keep manual notes and calculations outside the imported table because a refresh can resize or replace its rows.

6. Refresh the data

Refresh manually

Select Data → Refresh All. Excel runs the query again and replaces the imported rows.

Refresh when the workbook opens

  1. Open Data → Queries & Connections.
  2. Right-click NowMetrix Daily and select Properties.
  3. Enable Refresh data when opening the file.

Refresh at an interval

  1. Open the same query properties.
  2. Enable Refresh every and enter an interval such as 60 minutes.
  3. Save the workbook.
Excel's interval refresh normally runs only while the desktop workbook is open. It is not an unattended cloud schedule. Use Power BI Service if the dataset must refresh when nobody has Excel open.

Avoid unnecessarily frequent refreshes. The NowMetrix API limit is shared per tracker across API keys and users. Microsoft explains Excel connection settings in its external data refresh guide.

Export other NowMetrix data

The REST API provides several datasets for different reporting needs:

Use case Endpoint example Recommended refresh
Daily Pageviews and Visits /v1/overview?days=30 Hourly or daily
Yesterday's top pages /v1/recap?preset=yesterday&limit=100 Once per completed day
Current live snapshot /v1/realtime Only as often as the report needs
Current traffic sources /v1/sources Replace the current snapshot
Each endpoint returns a different JSON structure. Changing only RelativePath is not enough; the Power Query transformation below Response must also match the selected endpoint. Use the response example on the endpoint's reference page when adapting the query.

Security and sharing checklist

  • Use a separate NowMetrix key labeled for this workbook.
  • Grant the NowMetrix user only the tracker access required for the export.
  • Do not store the API key in a worksheet cell, formula, URL, screenshot, or comment.
  • Do not upload the workbook to a public download area.
  • Share the workbook only with people who are allowed to use the API key.
  • Treat every workbook editor as able to inspect the Power Query and read its key.
  • Protect access to OneDrive or SharePoint if the workbook is stored there.
  • Revoke the dedicated key immediately if the workbook or account may be compromised.
  • After rotating a key, update the first line of the query and refresh the workbook.
Hiding a worksheet or query does not make the API key secret. Power Query stores the query in the workbook. Restricting access to the file and using a dedicated revocable key are the most important safeguards.

Troubleshooting

Problem What to check
Power Query asks for credentials repeatedly Open Data source settings, clear the permissions for https://api.nowmetrix.com, reconnect, and choose Anonymous.
401 or “access to the resource is forbidden” Confirm that the complete API key replaced nm_YOUR_KEY, contains no spaces, and has not been revoked.
403 The API key's NowMetrix user cannot access the configured tracker. Verify TRACKER_ID and tracker permissions.
429 The tracker-wide rate limit was exceeded. Wait and reduce the refresh frequency.
503 The analytics backend is temporarily unavailable. Keep the existing table and retry later.
Expression.Error: The field 'daily' wasn't found The API returned a different structure or the endpoint was changed. Restore v1/overview or adapt the transformation.
Dates or numbers have the wrong format Check the locale used by Excel. The query assigns explicit date and whole-number types, but the worksheet display still follows the workbook locale.
Refresh works in the editor but not after reopening Check the query properties, data source permissions, network access, and whether your organization blocks external web connections.