> ## Documentation Index
> Fetch the complete documentation index at: https://api.globalwebindex.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# v1 Calculate Chart Metrics

> Get calculated metrics with the help of extenral calculations service (v2).



## OpenAPI

````yaml post /v1/charts/{id}/calculate
openapi: 3.0.0
info:
  contact:
    name: Slack Channel
    url: https://globalwebindex.slack.com/archives/CQV0R87DG
  description: platform-charts public API for Platform2.0
  license:
    name: GWI Platform 2.0 Community
    url: https://github.com/orgs/GlobalWebIndex/teams/engineering-platform-2-0
  title: platform-charts-api
  version: 0.0.1
servers:
  - url: http://api.globalwebindex.com
  - url: https://api.globalwebindex.com
security: []
paths:
  /v1/charts/{id}/calculate:
    post:
      tags:
        - Charts
      summary: v1 Calculate Chart Metrics
      description: >-
        Get calculated metrics with the help of extenral calculations service
        (v2).
      parameters:
        - description: Chart id.
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/calculations.CalculationResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.ErrorResponse'
        '403':
          description: Invalid permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.ErrorResponse'
        '404':
          description: Invalid chart
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    calculations.CalculationResponse:
      properties:
        meta: {}
        stats:
          items:
            $ref: '#/components/schemas/calculations.GroupStats'
          type: array
      type: object
    common.ErrorResponse:
      properties:
        code:
          type: integer
        message:
          type: string
      type: object
    calculations.GroupStats:
      properties:
        attributes:
          items:
            $ref: '#/components/schemas/calculations.Attribute'
          type: array
        code:
          type: integer
        data:
          items:
            $ref: '#/components/schemas/calculations.Datum'
          type: array
        error:
          type: string
        error_type:
          type: string
        group_id:
          type: integer
        meta: {}
      type: object
    calculations.Attribute:
      properties:
        compatibilities_metadata:
          $ref: '#/components/schemas/calculations.CompatibilitiesMetadata'
        datapoint_code:
          type: string
        datapoint_label:
          type: string
        generated_text:
          type: string
        namespace_code:
          type: string
        order:
          type: number
        question_code:
          type: string
        question_description:
          type: string
        question_label:
          type: string
        suffix_code:
          type: string
        suffix_label:
          type: string
        taxonomy_paths:
          items:
            $ref: '#/components/schemas/calculations.TaxonomyPath'
          type: array
      type: object
    calculations.Datum:
      properties:
        audience:
          type: string
        metrics:
          $ref: '#/components/schemas/calculations.Metrics'
        segment:
          type: string
        waves:
          items:
            type: string
          type: array
      type: object
    calculations.CompatibilitiesMetadata:
      properties:
        has_compatibilities:
          type: boolean
        has_incompatibilities:
          type: boolean
      type: object
    calculations.TaxonomyPath:
      properties:
        dataset:
          $ref: '#/components/schemas/calculations.Dataset'
        taxonomy_path:
          items:
            $ref: '#/components/schemas/calculations.TaxonomyPathCategory'
          type: array
      type: object
    calculations.Metrics:
      properties:
        audience_index:
          type: number
        audience_percentage:
          type: number
        audience_sample:
          type: integer
        audience_size:
          type: integer
        datapoint_percentage:
          type: number
        datapoint_sample:
          type: integer
        datapoint_size:
          type: integer
        positive_sample:
          type: integer
        positive_size:
          type: integer
      type: object
    calculations.Dataset:
      properties:
        base_namespace_code:
          type: string
        categories:
          items:
            $ref: '#/components/schemas/calculations.Category'
          type: array
        code:
          type: string
        depth:
          type: integer
        description:
          type: string
        name:
          type: string
        order:
          type: number
      type: object
    calculations.TaxonomyPathCategory:
      properties:
        attributes_count:
          type: integer
        category_children:
          items:
            $ref: '#/components/schemas/calculations.Category'
          type: array
        description:
          type: string
        height:
          type: integer
        id:
          type: string
        name:
          type: string
        order:
          type: number
        question_children:
          items:
            $ref: '#/components/schemas/calculations.Question'
          type: array
        taxonomy_paths:
          items:
            $ref: '#/components/schemas/calculations.TaxonomyPath'
          type: array
      type: object
    calculations.Category:
      properties:
        attributes_count:
          type: integer
        category_children:
          items:
            $ref: '#/components/schemas/calculations.Category'
          type: array
        description:
          type: string
        id:
          type: string
        name:
          type: string
        order:
          type: number
        question_children:
          items:
            $ref: '#/components/schemas/calculations.Question'
          type: array
        taxonomy_paths:
          items:
            $ref: '#/components/schemas/calculations.TaxonomyPath'
          type: array
      type: object
    calculations.Question:
      properties:
        accessible:
          type: boolean
        attributes:
          items:
            $ref: '#/components/schemas/calculations.Attribute'
          type: array
        average_unit:
          type: string
        flags:
          items:
            type: string
          type: array
        has_suffixes:
          type: boolean
        knowledge_base:
          type: string
        message:
          type: string
        namespace_code:
          type: string
        notice:
          type: string
        order:
          type: number
        question_code:
          type: string
        question_description:
          type: string
        question_label:
          type: string
        taxonomy_paths:
          items:
            $ref: '#/components/schemas/calculations.TaxonomyPath'
          type: array
        warning:
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: JWT token for authentication
      in: header
      name: Authorization
      type: apiKey

````