Export Analytics Data
curl --request POST \
--url https://api.gurubase.io/api/v1/{guru_slug}/analytics/export/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"export_type": "<string>",
"interval": "<string>",
"filters": {
"questions": "<string>",
"out_of_context": "<string>",
"referenced_sources": "<string>"
}
}
'import requests
url = "https://api.gurubase.io/api/v1/{guru_slug}/analytics/export/"
payload = {
"export_type": "<string>",
"interval": "<string>",
"filters": {
"questions": "<string>",
"out_of_context": "<string>",
"referenced_sources": "<string>"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
export_type: '<string>',
interval: '<string>',
filters: {
questions: '<string>',
out_of_context: '<string>',
referenced_sources: '<string>'
}
})
};
fetch('https://api.gurubase.io/api/v1/{guru_slug}/analytics/export/', 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.gurubase.io/api/v1/{guru_slug}/analytics/export/",
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([
'export_type' => '<string>',
'interval' => '<string>',
'filters' => [
'questions' => '<string>',
'out_of_context' => '<string>',
'referenced_sources' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gurubase.io/api/v1/{guru_slug}/analytics/export/"
payload := strings.NewReader("{\n \"export_type\": \"<string>\",\n \"interval\": \"<string>\",\n \"filters\": {\n \"questions\": \"<string>\",\n \"out_of_context\": \"<string>\",\n \"referenced_sources\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.gurubase.io/api/v1/{guru_slug}/analytics/export/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"export_type\": \"<string>\",\n \"interval\": \"<string>\",\n \"filters\": {\n \"questions\": \"<string>\",\n \"out_of_context\": \"<string>\",\n \"referenced_sources\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gurubase.io/api/v1/{guru_slug}/analytics/export/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"export_type\": \"<string>\",\n \"interval\": \"<string>\",\n \"filters\": {\n \"questions\": \"<string>\",\n \"out_of_context\": \"<string>\",\n \"referenced_sources\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"questions": [
{
"datetime": "2025-04-10 07:06",
"source": "Gurubase UI",
"question": "details for self hosted",
"trust_score": 0.6,
"follow_up": true,
"url": "https://app.gurubase.io/g/gurubase/what-is-gurubase/binge/0f973a34-7867-46ca-9c38-896d4b644d63?question_slug=details-for-self-hosting-gurubase-6014cb17-1a95-4308-969d-b61cf435f312"
}
],
"out_of_context": [
{
"datetime": "2025-04-08 06:45",
"source": "Github",
"question": "who made gurubase?"
}
],
"referenced_sources": [
{
"last_update_date": "2025-04-04 12:23",
"data_source_type": "Website",
"data_source_title": "Quickstart - Gurubase",
"referenced_count": 187,
"url": "https://docs.gurubase.ai/quickstart"
}
]
}
[Binary Excel file content]
[Binary ZIP file containing CSV files]
{
"msg": "No data found to export"
}
{
"msg": "Invalid request"
}
{
"msg": "Internal server error"
}
Endpoints
Export Analytics Data
Export analytics data in various formats (Excel, CSV, or JSON)
POST
/
{guru_slug}
/
analytics
/
export
/
Export Analytics Data
curl --request POST \
--url https://api.gurubase.io/api/v1/{guru_slug}/analytics/export/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"export_type": "<string>",
"interval": "<string>",
"filters": {
"questions": "<string>",
"out_of_context": "<string>",
"referenced_sources": "<string>"
}
}
'import requests
url = "https://api.gurubase.io/api/v1/{guru_slug}/analytics/export/"
payload = {
"export_type": "<string>",
"interval": "<string>",
"filters": {
"questions": "<string>",
"out_of_context": "<string>",
"referenced_sources": "<string>"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
export_type: '<string>',
interval: '<string>',
filters: {
questions: '<string>',
out_of_context: '<string>',
referenced_sources: '<string>'
}
})
};
fetch('https://api.gurubase.io/api/v1/{guru_slug}/analytics/export/', 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.gurubase.io/api/v1/{guru_slug}/analytics/export/",
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([
'export_type' => '<string>',
'interval' => '<string>',
'filters' => [
'questions' => '<string>',
'out_of_context' => '<string>',
'referenced_sources' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gurubase.io/api/v1/{guru_slug}/analytics/export/"
payload := strings.NewReader("{\n \"export_type\": \"<string>\",\n \"interval\": \"<string>\",\n \"filters\": {\n \"questions\": \"<string>\",\n \"out_of_context\": \"<string>\",\n \"referenced_sources\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.gurubase.io/api/v1/{guru_slug}/analytics/export/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"export_type\": \"<string>\",\n \"interval\": \"<string>\",\n \"filters\": {\n \"questions\": \"<string>\",\n \"out_of_context\": \"<string>\",\n \"referenced_sources\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gurubase.io/api/v1/{guru_slug}/analytics/export/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"export_type\": \"<string>\",\n \"interval\": \"<string>\",\n \"filters\": {\n \"questions\": \"<string>\",\n \"out_of_context\": \"<string>\",\n \"referenced_sources\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"questions": [
{
"datetime": "2025-04-10 07:06",
"source": "Gurubase UI",
"question": "details for self hosted",
"trust_score": 0.6,
"follow_up": true,
"url": "https://app.gurubase.io/g/gurubase/what-is-gurubase/binge/0f973a34-7867-46ca-9c38-896d4b644d63?question_slug=details-for-self-hosting-gurubase-6014cb17-1a95-4308-969d-b61cf435f312"
}
],
"out_of_context": [
{
"datetime": "2025-04-08 06:45",
"source": "Github",
"question": "who made gurubase?"
}
],
"referenced_sources": [
{
"last_update_date": "2025-04-04 12:23",
"data_source_type": "Website",
"data_source_title": "Quickstart - Gurubase",
"referenced_count": 187,
"url": "https://docs.gurubase.ai/quickstart"
}
]
}
[Binary Excel file content]
[Binary ZIP file containing CSV files]
{
"msg": "No data found to export"
}
{
"msg": "Invalid request"
}
{
"msg": "Internal server error"
}
Export analytics data for questions, out-of-context queries, and referenced sources. The data can be exported in different formats and filtered based on various criteria.
Headers
string
required
Your API key for authentication. You can obtain your API key from the Gurubase dashboard.
Request Body
string
default:"xlsx"
required
Format of the export file. Possible values:
xlsx, csv, jsonxlsx: Microsoft Excel formatcsv: Compressed ZIP containing CSV filesjson: JSON format
string
default:"today"
Time period for the analytics data. Possible values:
today: Current dayyesterday: Previous day7d: Last 7 days30d: Last 30 days3m: Last 3 months6m: Last 6 months12m: Last 12 months
object
Filters for different types of data
Show Filter options
Show Filter options
string
default:"all"
Filter for questions data. Possible values:
all: All sourceswidget: Widget sourceuser: Gurubase UI sourceapi: API sourcediscord: Discord sourceslack: Slack sourcegithub: GitHub source
string
default:"all"
Filter for out-of-context queries. Same values as questions filter.
string
default:"all"
Filter for referenced sources. Possible values:
all: All sourcesgithub_repo: GitHub repositorieswebsite: Websitesyoutube: YouTube videospdf: PDF documents
Response
The response will be a file download with the appropriate content type header based on the export_type:- XLSX:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet - CSV:
application/zip - JSON:
application/json
{
"questions": [
{
"datetime": "2025-04-10 07:06",
"source": "Gurubase UI",
"question": "details for self hosted",
"trust_score": 0.6,
"follow_up": true,
"url": "https://app.gurubase.io/g/gurubase/what-is-gurubase/binge/0f973a34-7867-46ca-9c38-896d4b644d63?question_slug=details-for-self-hosting-gurubase-6014cb17-1a95-4308-969d-b61cf435f312"
}
],
"out_of_context": [
{
"datetime": "2025-04-08 06:45",
"source": "Github",
"question": "who made gurubase?"
}
],
"referenced_sources": [
{
"last_update_date": "2025-04-04 12:23",
"data_source_type": "Website",
"data_source_title": "Quickstart - Gurubase",
"referenced_count": 187,
"url": "https://docs.gurubase.ai/quickstart"
}
]
}
[Binary Excel file content]
[Binary ZIP file containing CSV files]
{
"msg": "No data found to export"
}
{
"msg": "Invalid request"
}
{
"msg": "Internal server error"
}
Was this page helpful?
⌘I