Run a report query
curl --request POST \
--url https://app.withgauge.com/api/v1/orgs/{org}/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metrics": [
"<string>"
],
"dimensions": [
"<string>"
],
"filters": {
"category": "<string>",
"brand": [
"<string>"
],
"model": [
"<string>"
],
"topic": [
"<string>"
],
"tag": [
"<string>"
],
"tagMode": "any",
"prompt": [
"<string>"
],
"trackingType": "visibility",
"domain": [
"<string>"
],
"page": [
"<string>"
]
},
"where": [
{
"dimension": "<string>",
"value": "<string>"
}
],
"dateRange": {
"since": "<string>",
"until": "<string>",
"lastDays": 200
},
"granularity": "day",
"orderBy": [
{
"key": "<string>",
"dir": "desc"
}
],
"limit": 50
}
'import requests
url = "https://app.withgauge.com/api/v1/orgs/{org}/query"
payload = {
"metrics": ["<string>"],
"dimensions": ["<string>"],
"filters": {
"category": "<string>",
"brand": ["<string>"],
"model": ["<string>"],
"topic": ["<string>"],
"tag": ["<string>"],
"tagMode": "any",
"prompt": ["<string>"],
"trackingType": "visibility",
"domain": ["<string>"],
"page": ["<string>"]
},
"where": [
{
"dimension": "<string>",
"value": "<string>"
}
],
"dateRange": {
"since": "<string>",
"until": "<string>",
"lastDays": 200
},
"granularity": "day",
"orderBy": [
{
"key": "<string>",
"dir": "desc"
}
],
"limit": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metrics: ['<string>'],
dimensions: ['<string>'],
filters: {
category: '<string>',
brand: ['<string>'],
model: ['<string>'],
topic: ['<string>'],
tag: ['<string>'],
tagMode: 'any',
prompt: ['<string>'],
trackingType: 'visibility',
domain: ['<string>'],
page: ['<string>']
},
where: [{dimension: '<string>', value: '<string>'}],
dateRange: {since: '<string>', until: '<string>', lastDays: 200},
granularity: 'day',
orderBy: [{key: '<string>', dir: 'desc'}],
limit: 50
})
};
fetch('https://app.withgauge.com/api/v1/orgs/{org}/query', 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://app.withgauge.com/api/v1/orgs/{org}/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metrics' => [
'<string>'
],
'dimensions' => [
'<string>'
],
'filters' => [
'category' => '<string>',
'brand' => [
'<string>'
],
'model' => [
'<string>'
],
'topic' => [
'<string>'
],
'tag' => [
'<string>'
],
'tagMode' => 'any',
'prompt' => [
'<string>'
],
'trackingType' => 'visibility',
'domain' => [
'<string>'
],
'page' => [
'<string>'
]
],
'where' => [
[
'dimension' => '<string>',
'value' => '<string>'
]
],
'dateRange' => [
'since' => '<string>',
'until' => '<string>',
'lastDays' => 200
],
'granularity' => 'day',
'orderBy' => [
[
'key' => '<string>',
'dir' => 'desc'
]
],
'limit' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.withgauge.com/api/v1/orgs/{org}/query"
payload := strings.NewReader("{\n \"metrics\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": {\n \"category\": \"<string>\",\n \"brand\": [\n \"<string>\"\n ],\n \"model\": [\n \"<string>\"\n ],\n \"topic\": [\n \"<string>\"\n ],\n \"tag\": [\n \"<string>\"\n ],\n \"tagMode\": \"any\",\n \"prompt\": [\n \"<string>\"\n ],\n \"trackingType\": \"visibility\",\n \"domain\": [\n \"<string>\"\n ],\n \"page\": [\n \"<string>\"\n ]\n },\n \"where\": [\n {\n \"dimension\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"dateRange\": {\n \"since\": \"<string>\",\n \"until\": \"<string>\",\n \"lastDays\": 200\n },\n \"granularity\": \"day\",\n \"orderBy\": [\n {\n \"key\": \"<string>\",\n \"dir\": \"desc\"\n }\n ],\n \"limit\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.withgauge.com/api/v1/orgs/{org}/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metrics\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": {\n \"category\": \"<string>\",\n \"brand\": [\n \"<string>\"\n ],\n \"model\": [\n \"<string>\"\n ],\n \"topic\": [\n \"<string>\"\n ],\n \"tag\": [\n \"<string>\"\n ],\n \"tagMode\": \"any\",\n \"prompt\": [\n \"<string>\"\n ],\n \"trackingType\": \"visibility\",\n \"domain\": [\n \"<string>\"\n ],\n \"page\": [\n \"<string>\"\n ]\n },\n \"where\": [\n {\n \"dimension\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"dateRange\": {\n \"since\": \"<string>\",\n \"until\": \"<string>\",\n \"lastDays\": 200\n },\n \"granularity\": \"day\",\n \"orderBy\": [\n {\n \"key\": \"<string>\",\n \"dir\": \"desc\"\n }\n ],\n \"limit\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.withgauge.com/api/v1/orgs/{org}/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metrics\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": {\n \"category\": \"<string>\",\n \"brand\": [\n \"<string>\"\n ],\n \"model\": [\n \"<string>\"\n ],\n \"topic\": [\n \"<string>\"\n ],\n \"tag\": [\n \"<string>\"\n ],\n \"tagMode\": \"any\",\n \"prompt\": [\n \"<string>\"\n ],\n \"trackingType\": \"visibility\",\n \"domain\": [\n \"<string>\"\n ],\n \"page\": [\n \"<string>\"\n ]\n },\n \"where\": [\n {\n \"dimension\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"dateRange\": {\n \"since\": \"<string>\",\n \"until\": \"<string>\",\n \"lastDays\": 200\n },\n \"granularity\": \"day\",\n \"orderBy\": [\n {\n \"key\": \"<string>\",\n \"dir\": \"desc\"\n }\n ],\n \"limit\": 50\n}"
response = http.request(request)
puts response.read_body{
"columns": [
{
"key": "<string>",
"kind": "dimension",
"type": "<string>",
"unit": "<string>"
}
],
"rows": [
{}
],
"labels": {},
"dateRange": {
"since": "<string>",
"until": "<string>"
},
"truncated": true,
"cached": true,
"freshness": {
"watermark": "<string>",
"pending": 123,
"available": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
}Run a report query
Query a dataset with server-defined metrics. See query/metadata for
what each dataset supports.
POST
/
orgs
/
{org}
/
query
Run a report query
curl --request POST \
--url https://app.withgauge.com/api/v1/orgs/{org}/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metrics": [
"<string>"
],
"dimensions": [
"<string>"
],
"filters": {
"category": "<string>",
"brand": [
"<string>"
],
"model": [
"<string>"
],
"topic": [
"<string>"
],
"tag": [
"<string>"
],
"tagMode": "any",
"prompt": [
"<string>"
],
"trackingType": "visibility",
"domain": [
"<string>"
],
"page": [
"<string>"
]
},
"where": [
{
"dimension": "<string>",
"value": "<string>"
}
],
"dateRange": {
"since": "<string>",
"until": "<string>",
"lastDays": 200
},
"granularity": "day",
"orderBy": [
{
"key": "<string>",
"dir": "desc"
}
],
"limit": 50
}
'import requests
url = "https://app.withgauge.com/api/v1/orgs/{org}/query"
payload = {
"metrics": ["<string>"],
"dimensions": ["<string>"],
"filters": {
"category": "<string>",
"brand": ["<string>"],
"model": ["<string>"],
"topic": ["<string>"],
"tag": ["<string>"],
"tagMode": "any",
"prompt": ["<string>"],
"trackingType": "visibility",
"domain": ["<string>"],
"page": ["<string>"]
},
"where": [
{
"dimension": "<string>",
"value": "<string>"
}
],
"dateRange": {
"since": "<string>",
"until": "<string>",
"lastDays": 200
},
"granularity": "day",
"orderBy": [
{
"key": "<string>",
"dir": "desc"
}
],
"limit": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metrics: ['<string>'],
dimensions: ['<string>'],
filters: {
category: '<string>',
brand: ['<string>'],
model: ['<string>'],
topic: ['<string>'],
tag: ['<string>'],
tagMode: 'any',
prompt: ['<string>'],
trackingType: 'visibility',
domain: ['<string>'],
page: ['<string>']
},
where: [{dimension: '<string>', value: '<string>'}],
dateRange: {since: '<string>', until: '<string>', lastDays: 200},
granularity: 'day',
orderBy: [{key: '<string>', dir: 'desc'}],
limit: 50
})
};
fetch('https://app.withgauge.com/api/v1/orgs/{org}/query', 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://app.withgauge.com/api/v1/orgs/{org}/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metrics' => [
'<string>'
],
'dimensions' => [
'<string>'
],
'filters' => [
'category' => '<string>',
'brand' => [
'<string>'
],
'model' => [
'<string>'
],
'topic' => [
'<string>'
],
'tag' => [
'<string>'
],
'tagMode' => 'any',
'prompt' => [
'<string>'
],
'trackingType' => 'visibility',
'domain' => [
'<string>'
],
'page' => [
'<string>'
]
],
'where' => [
[
'dimension' => '<string>',
'value' => '<string>'
]
],
'dateRange' => [
'since' => '<string>',
'until' => '<string>',
'lastDays' => 200
],
'granularity' => 'day',
'orderBy' => [
[
'key' => '<string>',
'dir' => 'desc'
]
],
'limit' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.withgauge.com/api/v1/orgs/{org}/query"
payload := strings.NewReader("{\n \"metrics\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": {\n \"category\": \"<string>\",\n \"brand\": [\n \"<string>\"\n ],\n \"model\": [\n \"<string>\"\n ],\n \"topic\": [\n \"<string>\"\n ],\n \"tag\": [\n \"<string>\"\n ],\n \"tagMode\": \"any\",\n \"prompt\": [\n \"<string>\"\n ],\n \"trackingType\": \"visibility\",\n \"domain\": [\n \"<string>\"\n ],\n \"page\": [\n \"<string>\"\n ]\n },\n \"where\": [\n {\n \"dimension\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"dateRange\": {\n \"since\": \"<string>\",\n \"until\": \"<string>\",\n \"lastDays\": 200\n },\n \"granularity\": \"day\",\n \"orderBy\": [\n {\n \"key\": \"<string>\",\n \"dir\": \"desc\"\n }\n ],\n \"limit\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.withgauge.com/api/v1/orgs/{org}/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metrics\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": {\n \"category\": \"<string>\",\n \"brand\": [\n \"<string>\"\n ],\n \"model\": [\n \"<string>\"\n ],\n \"topic\": [\n \"<string>\"\n ],\n \"tag\": [\n \"<string>\"\n ],\n \"tagMode\": \"any\",\n \"prompt\": [\n \"<string>\"\n ],\n \"trackingType\": \"visibility\",\n \"domain\": [\n \"<string>\"\n ],\n \"page\": [\n \"<string>\"\n ]\n },\n \"where\": [\n {\n \"dimension\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"dateRange\": {\n \"since\": \"<string>\",\n \"until\": \"<string>\",\n \"lastDays\": 200\n },\n \"granularity\": \"day\",\n \"orderBy\": [\n {\n \"key\": \"<string>\",\n \"dir\": \"desc\"\n }\n ],\n \"limit\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.withgauge.com/api/v1/orgs/{org}/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metrics\": [\n \"<string>\"\n ],\n \"dimensions\": [\n \"<string>\"\n ],\n \"filters\": {\n \"category\": \"<string>\",\n \"brand\": [\n \"<string>\"\n ],\n \"model\": [\n \"<string>\"\n ],\n \"topic\": [\n \"<string>\"\n ],\n \"tag\": [\n \"<string>\"\n ],\n \"tagMode\": \"any\",\n \"prompt\": [\n \"<string>\"\n ],\n \"trackingType\": \"visibility\",\n \"domain\": [\n \"<string>\"\n ],\n \"page\": [\n \"<string>\"\n ]\n },\n \"where\": [\n {\n \"dimension\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"dateRange\": {\n \"since\": \"<string>\",\n \"until\": \"<string>\",\n \"lastDays\": 200\n },\n \"granularity\": \"day\",\n \"orderBy\": [\n {\n \"key\": \"<string>\",\n \"dir\": \"desc\"\n }\n ],\n \"limit\": 50\n}"
response = http.request(request)
puts response.read_body{
"columns": [
{
"key": "<string>",
"kind": "dimension",
"type": "<string>",
"unit": "<string>"
}
],
"rows": [
{}
],
"labels": {},
"dateRange": {
"since": "<string>",
"until": "<string>"
},
"truncated": true,
"cached": true,
"freshness": {
"watermark": "<string>",
"pending": 123,
"available": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
}Authorizations
An organization API key from Settings → Integrations → API Keys, or a Gauge CLI login token from gauge auth login.
Path Parameters
Body
application/json
Available options:
answers, citations, searchQueries, aiTraffic Required array length:
1 - 4 elementsMaximum array length:
3Show child attributes
Show child attributes
Maximum array length:
10Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
hour, day, week, month Maximum array length:
4Show child attributes
Show child attributes
Required range:
1 <= x <= 1000Response
OK
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes