Skip to Content
Metrics

Get Preview Data

POST
/v0/projects/{idOrSlug}/metrics/preview

Authorization

apiKeyAuth
headerx-api-key<token>

FastStats API key. Pass it in the x-api-key header or as a Bearer token in the Authorization header.

Path Parameters

idOrSlug*string

Request Body

application/json
  1. body
queryConfig*
chartType*string
Value in"bar""line""pie""area""widget""map""list""heatmap""radar""scatter""treemap""table"
query*

Response Body

Success

application/json
  1. response
data*unknown
flowMeta*
markers?array<>|null
markerCollectionGrouping?|null
Example Request
curl -X POST 'https://api.faststats.dev/v0/projects/string/metrics/preview' \
  -H 'Content-Type: application/json' \
  -d '{
  "queryConfig": {},
  "chartType": "bar",
  "query": {
    "type": "flow",
    "nodes": [
      {
        "id": "string"
      }
    ],
    "edges": [
      {
        "id": "string",
        "source": "string",
        "target": "string"
      }
    ]
  }
}'
Example Response
{
  "data": null,
  "flowMeta": {
    "outputs": [
      {
        "id": "string",
        "index": 0,
        "name": "string",
        "explicitName": "string",
        "iconSetId": "string",
        "color": "string",
        "colors": [
          "string"
        ],
        "sort": {
          "by": "value",
          "direction": "asc"
        },
        "splitPattern": "string",
        "splitDataSource": "string",
        "groupField": "string",
        "groupFields": [
          "string"
        ],
        "primaryMetric": {
          "field": "string",
          "aggregation": "string"
        },
        "dailyRollup": "sum"
      }
    ],
    "hasTimeGroup": true,
    "hasBreakdownTimeSeries": true,
    "datasourceFields": [
      "string"
    ],
    "splitLabelSeparator": "string",
    "timeGroupInterval": "auto"
  },
  "markers": [
    {
      "id": "string",
      "collectionId": "string",
      "collectionName": "string",
      "timestamp": "string",
      "title": "string",
      "description": "string",
      "icon": "string",
      "emoji": "string",
      "color": "string"
    }
  ],
  "markerCollectionGrouping": {
    "property1": "auto",
    "property2": "auto"
  }
}