Skip to main content
POST
/
v1
/
charts
/
{id}
/
calculate
v1 Calculate Chart Metrics
curl --request POST \
  --url http://api.globalwebindex.com/v1/charts/{id}/calculate \
  --header 'Authorization: <api-key>'
import requests

url = "http://api.globalwebindex.com/v1/charts/{id}/calculate"

headers = {"Authorization": "<api-key>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};

fetch('http://api.globalwebindex.com/v1/charts/{id}/calculate', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "http://api.globalwebindex.com/v1/charts/{id}/calculate",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Authorization: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://api.globalwebindex.com/v1/charts/{id}/calculate"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("http://api.globalwebindex.com/v1/charts/{id}/calculate")
  .header("Authorization", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("http://api.globalwebindex.com/v1/charts/{id}/calculate")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "meta": "<unknown>",
  "stats": [
    {
      "attributes": [
        {
          "compatibilities_metadata": {
            "has_compatibilities": true,
            "has_incompatibilities": true
          },
          "datapoint_code": "<string>",
          "datapoint_label": "<string>",
          "generated_text": "<string>",
          "namespace_code": "<string>",
          "order": 123,
          "question_code": "<string>",
          "question_description": "<string>",
          "question_label": "<string>",
          "suffix_code": "<string>",
          "suffix_label": "<string>",
          "taxonomy_paths": [
            {
              "dataset": {
                "base_namespace_code": "<string>",
                "categories": [
                  {
                    "attributes_count": 123,
                    "category_children": "<array>",
                    "description": "<string>",
                    "id": "<string>",
                    "name": "<string>",
                    "order": 123,
                    "question_children": [
                      {
                        "accessible": true,
                        "attributes": "<array>",
                        "average_unit": "<string>",
                        "flags": [
                          "<string>"
                        ],
                        "has_suffixes": true,
                        "knowledge_base": "<string>",
                        "message": "<string>",
                        "namespace_code": "<string>",
                        "notice": "<string>",
                        "order": 123,
                        "question_code": "<string>",
                        "question_description": "<string>",
                        "question_label": "<string>",
                        "taxonomy_paths": "<array>",
                        "warning": "<string>"
                      }
                    ],
                    "taxonomy_paths": "<array>"
                  }
                ],
                "code": "<string>",
                "depth": 123,
                "description": "<string>",
                "name": "<string>",
                "order": 123
              },
              "taxonomy_path": [
                {
                  "attributes_count": 123,
                  "category_children": [
                    {
                      "attributes_count": 123,
                      "category_children": "<array>",
                      "description": "<string>",
                      "id": "<string>",
                      "name": "<string>",
                      "order": 123,
                      "question_children": [
                        {
                          "accessible": true,
                          "attributes": "<array>",
                          "average_unit": "<string>",
                          "flags": [
                            "<string>"
                          ],
                          "has_suffixes": true,
                          "knowledge_base": "<string>",
                          "message": "<string>",
                          "namespace_code": "<string>",
                          "notice": "<string>",
                          "order": 123,
                          "question_code": "<string>",
                          "question_description": "<string>",
                          "question_label": "<string>",
                          "taxonomy_paths": "<array>",
                          "warning": "<string>"
                        }
                      ],
                      "taxonomy_paths": "<array>"
                    }
                  ],
                  "description": "<string>",
                  "height": 123,
                  "id": "<string>",
                  "name": "<string>",
                  "order": 123,
                  "question_children": [
                    {
                      "accessible": true,
                      "attributes": "<array>",
                      "average_unit": "<string>",
                      "flags": [
                        "<string>"
                      ],
                      "has_suffixes": true,
                      "knowledge_base": "<string>",
                      "message": "<string>",
                      "namespace_code": "<string>",
                      "notice": "<string>",
                      "order": 123,
                      "question_code": "<string>",
                      "question_description": "<string>",
                      "question_label": "<string>",
                      "taxonomy_paths": "<array>",
                      "warning": "<string>"
                    }
                  ],
                  "taxonomy_paths": "<array>"
                }
              ]
            }
          ]
        }
      ],
      "code": 123,
      "data": [
        {
          "audience": "<string>",
          "metrics": {
            "audience_index": 123,
            "audience_percentage": 123,
            "audience_sample": 123,
            "audience_size": 123,
            "datapoint_percentage": 123,
            "datapoint_sample": 123,
            "datapoint_size": 123,
            "positive_sample": 123,
            "positive_size": 123
          },
          "segment": "<string>",
          "waves": [
            "<string>"
          ]
        }
      ],
      "error": "<string>",
      "error_type": "<string>",
      "group_id": 123,
      "meta": "<unknown>"
    }
  ]
}
{
  "code": 123,
  "message": "<string>"
}
{
  "code": 123,
  "message": "<string>"
}
{
  "code": 123,
  "message": "<string>"
}
{
  "code": 123,
  "message": "<string>"
}

Authorizations

Authorization
string
header
required

JWT token for authentication

Path Parameters

id
string
required

Chart id.

Response

OK

meta
any
stats
object[]