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.
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
- Sign in to NowMetrix.
- Open Settings → API.
- Create a new key with a clear label, for example Microsoft Excel.
- Copy the complete key immediately. It is shown only once.
- 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 |
2. Open a blank Power Query
Excel for Windows
- Create a new workbook or open the workbook that should contain the export.
- Select Data → Get Data → From Other Sources → Blank Query.
- In the Power Query Editor, select Home → Advanced Editor.
Excel for macOS
- Create a new workbook or open the target workbook.
- Select Data → Get Data (Power Query) → Launch Power Query Editor.
- Create a Blank Query, then open Home → Advanced Editor.
3. Paste the prepared query
- Remove the existing content from the Advanced Editor.
- Paste the complete query below.
- Replace
nm_YOUR_KEYandTRACKER_IDin the first two lines. - Leave the quotation marks around both values.
- 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.
- Choose Anonymous.
- Apply the setting to
https://api.nowmetrix.com. - Select Connect.
- If asked for a privacy level, select the level required by your organization. Private provides the strictest separation from other data sources.
5. Load and verify the table
- Wait until the Power Query preview displays five columns.
- Optionally rename the query to NowMetrix Daily.
- Select Home → Close & Load.
- 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
- Open Data → Queries & Connections.
- Right-click NowMetrix Daily and select Properties.
- Enable Refresh data when opening the file.
Refresh at an interval
- Open the same query properties.
- Enable Refresh every and enter an interval such as 60 minutes.
- Save the workbook.
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 |
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.
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. |