Skip to main content
POST
/
product-analytics
/
metric-exploration
cURL
curl -X POST https://api.growthbook.io/api/v1/product-analytics/metric-exploration -d '{ ... }' -u secret_abc123DEF456
{
  "exploration": {
    "id": "<string>",
    "dateCreated": "2023-11-07T05:31:56Z",
    "dateUpdated": "2023-11-07T05:31:56Z",
    "datasource": "<string>",
    "status": "running",
    "dateStart": "<string>",
    "dateEnd": "<string>",
    "result": {
      "rows": [
        {
          "dimensions": [
            "<string>"
          ],
          "values": [
            {
              "metricId": "<string>",
              "numerator": 123,
              "denominator": 123
            }
          ]
        }
      ]
    },
    "config": {
      "datasource": "<string>",
      "dimensions": [
        {
          "dimensionType": "<string>",
          "column": "<string>",
          "dateGranularity": "auto"
        }
      ],
      "chartType": "line",
      "dateRange": {
        "predefined": "today",
        "lookbackValue": 123,
        "lookbackUnit": "hour",
        "startDate": "<string>",
        "endDate": "<string>"
      },
      "type": "<string>",
      "dataset": {
        "type": "<string>",
        "values": [
          {
            "name": "<string>",
            "rowFilters": [
              {
                "operator": "=",
                "column": "<string>",
                "values": [
                  "<string>"
                ]
              }
            ],
            "type": "<string>",
            "metricId": "<string>",
            "unit": "<string>",
            "denominatorUnit": "<string>"
          }
        ]
      }
    },
    "error": "<string>"
  },
  "query": {
    "id": "<string>",
    "organization": "<string>",
    "datasource": "<string>",
    "language": "<string>",
    "query": "<string>",
    "queryType": "<string>",
    "createdAt": "<string>",
    "startedAt": "<string>",
    "status": "running",
    "externalId": "<string>",
    "dependencies": [
      "<string>"
    ],
    "runAtEnd": true
  },
  "explorationUrl": "<string>",
  "message": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://growthbook-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

If using Bearer auth, pass the Secret Key as the token:

curl https://api.growthbook.io/api/v1 \
-H "Authorization: Bearer secret_abc123DEF456"

Query Parameters

cache
enum<string>

Controls cache behavior for this exploration: preferred (default) returns a cached result if one exists, otherwise runs a new query; never always runs a new query, ignoring any cached results; required only returns a cached result, if none exists returns exploration: null with a message

Available options:
preferred,
required,
never

Body

application/json
datasource
string
required

ID of the datasource to query

dimensions
object[]
required
chartType
enum<string>
required
Available options:
line,
area,
timeseries-table,
table,
bar,
stackedBar,
horizontalBar,
stackedHorizontalBar,
bigNumber
dateRange
object
required
type
string
required
Allowed value: "metric"
dataset
object
required

Response

200 - application/json

Success

exploration
object
required
query
object
required
explorationUrl
string

A direct link to view this exploration in the GrowthBook Application.

message
string

Present when exploration is null, explaining why no result was returned.