Skip to main content
GET
/
v0
/
boards
/
{boardId}
/
charts
/
{chartId}
Get chart
curl --request GET \
  --url https://api.formo.so/v0/boards/{boardId}/charts/{chartId} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.formo.so/v0/boards/{boardId}/charts/{chartId}"

headers = {"Authorization": "Bearer <token>"}

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

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.formo.so/v0/boards/{boardId}/charts/{chartId}', 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 => "https://api.formo.so/v0/boards/{boardId}/charts/{chartId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$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 := "https://api.formo.so/v0/boards/{boardId}/charts/{chartId}"

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

req.Header.Add("Authorization", "Bearer <token>")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.formo.so/v0/boards/{boardId}/charts/{chartId}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.formo.so/v0/boards/{boardId}/charts/{chartId}")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "cht_x1y2z3a4b5c6",
  "project_id": "proj_abc123",
  "board_id": "brd_a1b2c3d4e5f6",
  "chart_type": "line",
  "title": "Daily revenue (last 30 days)",
  "description": null,
  "query": "SELECT toDate(timestamp) AS day, sum(revenue) AS revenue FROM events WHERE event = 'transaction' AND timestamp >= now() - INTERVAL 30 DAY GROUP BY day ORDER BY day",
  "x_axis": "day",
  "y_axis": [
    "revenue"
  ],
  "group_by": null,
  "steps": null,
  "settings": null
}

Authorizations

Authorization
string
header
required

Workspace API key (e.g. formo_xxx). Create one in the Formo dashboard under Team Settings > API Keys.

Path Parameters

boardId
string
required
chartId
string
required

Response

200 - application/json

Chart details

A saved chart attached to a board.

id
string
required
chart_type
enum<string>
required

Visualization type.

Available options:
table,
number,
funnel,
bar,
line,
pie,
stacked,
user_paths,
retention
title
string
required
query
string
required

SQL query powering the chart. For funnel and retention charts this is a system-managed placeholder.

project_id
string
required
board_id
string
required
description
string | null
x_axis
string | null

Column used as the X axis.

y_axis
string[] | null

Column(s) used as Y axis metric(s).

group_by
string | null

Column used to group/stack series.

steps
object[] | null

Ordered list of funnel steps. Only present when chart_type is funnel.

settings
object | null

Type-specific configuration. See ChartSettings for all fields.