POST
/
{guru_slug}
/
analytics
/
export
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>"
  }
}'
{
  "questions": [
    {
      "datetime": "2025-04-10 07:06",
      "source": "Gurubase UI",
      "question": "details for self hosted",
      "trust_score": 0.6,
      "follow_up": true,
      "url": "https://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"
    }
  ]
}

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.

Request Body

export_type
string
default:"xlsx"
required

Format of the export file. Possible values: xlsx, csv, json

  • xlsx: Microsoft Excel format
  • csv: Compressed ZIP containing CSV files
  • json: JSON format
interval
string
default:"today"

Time period for the analytics data. Possible values:

  • today: Current day
  • yesterday: Previous day
  • 7d: Last 7 days
  • 30d: Last 30 days
  • 3m: Last 3 months
  • 6m: Last 6 months
  • 12m: Last 12 months
filters
object

Filters for different types of data

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://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"
    }
  ]
}