Skip to content

Example: Console Log Inventory from Recent Pages

This example returns an inventory of browser console logs observed on the most recent page scans throughout your account.

  • The relative date filter restricts to page visits started in the last 30 days.
  • LOG_LEVEL and some other attributes are numeric enums. You can either call GET /v3/reports/grid/browser-logs/schema or use the generic schema endpoint referenced here: Grid schema.

Console log data can be very large and can produce millions of rows. Large unfiltered queries may time out. We strongly recommend applying filters to limit to a reasonable time window and to the most recent page scans and audit runs, as shown below.

Grid API Request

POST to https://api.observepoint.com/v3/reports/grid/browser-logs
{
  "columns": [
    { "columnId": "FINAL_PAGE_URL" },                   // The page URL where the log occurred.
    { "columnId": "PAGE_TITLE" },                       // The title of the page.
    { "columnId": "LOG_LEVEL" },                        // Numeric enum for the log level. See Enum Reference below.
    { "columnId": "LOG_TIME" },                         // ISO 8601 timestamp when the log was captured.
    { "columnId": "LOG_MESSAGE" },                      // The console log message text.
    { "columnId": "LOG_OCCURRENCES" },                  // Number of times this exact log was observed on the page visit.
    { "columnId": "RELATED_TAG" },                      // If applicable: [Tag Name, Tag Id]. May be null.
    { "columnId": "SOURCE_JAVASCRIPT_URL" },            // The script URL that emitted the log, when available.
    { "columnId": "SOURCE_JAVASCRIPT_LINE_NUMBER" },    // Source line number if captured.
    { "columnId": "SOURCE_JAVASCRIPT_COLUMN_NUMBER" }   // Source column number if captured.
  ],
  "filters": {
    "conditionMatchMode": "all",
    "conditions": [
      // Ensures only the latest scan per page.
      {
        "args": [1],
        "negated": false,
        "operator": "integer_in",
        "filteredColumn": { "columnId": "IS_MOST_RECENT_PAGE_SCAN" }
      },
      // Limits results to the latest run per property.
      {
        "args": [1],
        "negated": false,
        "operator": "integer_in",
        "filteredColumn": { "columnId": "IS_MOST_RECENT_RUN" }
      },
      {
        "startDuration": 30,
        "startUnit": "day",
        "negated": false,
        "operator": "date_time_relative",
        "filteredColumn": { "columnId": "ABSOLUTE_PAGE_VISIT_START_TIME" }
      }
    ],
    "allAccounts": false
  },
  "sortBy": [],
  "page": 0,
  "size": 10000
}

Example Response JSON

Console Log Grid API Response JSON
// Notes:
//  Each row is a single console log observation from a most recent page scan
//  LOG_LEVEL is a numeric enum. Example mapping is listed below in the Enum Reference section
{
  "metadata": {
    "pagination": {
      "totalCount": 10000,
      "totalPageCount": 1,
      "pageSize": 10000,
      "currentPageSize": 10000,
      "currentPageNumber": 0
    },
    "headers": [
      { "column": { "columnId": "FINAL_PAGE_URL" } },
      { "column": { "columnId": "PAGE_TITLE" } },
      { "column": { "columnId": "LOG_LEVEL" } },
      { "column": { "columnId": "LOG_TIME" } },
      { "column": { "columnId": "LOG_MESSAGE" } },
      { "column": { "columnId": "LOG_OCCURRENCES" } },
      { "column": { "columnId": "RELATED_TAG" } },
      { "column": { "columnId": "SOURCE_JAVASCRIPT_URL" } },
      { "column": { "columnId": "SOURCE_JAVASCRIPT_LINE_NUMBER" } },
      { "column": { "columnId": "SOURCE_JAVASCRIPT_COLUMN_NUMBER" } }
    ]
  },
  "rows": [
    [
      "https://example.com",
      "Example Page Title",
      2, // Warning
      "2025-01-01T00:00:00.000+00:00",
      "[Adobe Analytics] - Adobe Analytics Warning",
      1,
      ["Adobe Analytics", 1],
      "https://example.com/b/ss/report-suite-prod/1/JS-2.23.0-LEWM/s123456789",
      0,
      349973
    ],
    [
      "https://example.com",
      "Example Page Title",
      1, // Error
      "2025-01-01T00:00:00.000+00:00",
      "[Adobe Launch] - Adobe Launch Error",
      1,
      ["Adobe Launch", 556],
      "https://assets.adobedtm.com/0abc123ABC/0abc123ABC/launch-0abc123ABC.min.js",
      0,
      9846
    ],
    [
      "https://example.com",
      "Example Page Title",
      3,  // Info
      "2025-01-01T00:00:00.000+00:00",
      "PRINT CONSOLE LOG",
      2,
      null,
      "https://www.examplecdn.net/example/js/example.27.0M.js",
      10,
      1008
    ]
    // ... more rows omitted for brevity
  ]
}

Enum Reference

LOG_LEVEL values returned by the API map to the following labels. To fetch the current set directly from the API, call GET /v3/reports/grid/browser-logs/schema and inspect enumValues for the LOG_LEVEL column.

{
  "enumValues": [
    { "id": 1, "name": "Error" },
    { "id": 2, "name": "Warning" },
    { "id": 3, "name": "Info" },
    { "id": 4, "name": "Debug" }
  ]
}