curl --request POST \
--url https://api.trieve.ai/api/analytics \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TR-Dataset: <tr-dataset>' \
--data '{
"columns": [
{
"name": "<string>",
"aggregation": "SUM",
"alias": "<string>",
"distinct": true
}
],
"table": "search_queries",
"cte_query": {
"alias": "<string>",
"query": {
"columns": [
{
"name": "<string>",
"aggregation": "SUM",
"alias": "<string>",
"distinct": true
}
],
"table": "search_queries",
"expressions": [
{
"expression": {
"name": "<string>",
"type": "column"
},
"alias": "<string>"
}
],
"filter_conditions": [
{
"column": "<string>",
"operator": "=",
"value": "<string>",
"and_filter": [
"<unknown>"
],
"or_filter": [
"<unknown>"
]
}
],
"group_by": {
"columns": [
"<string>"
],
"having": {
"column": "<string>",
"function": "SUM",
"operator": "=",
"type": "aggregate",
"value": "<string>"
}
},
"joins": [
{
"condition": {
"left_column": "<string>",
"right_column": "<string>",
"type": "column_equals"
},
"table": "search_queries",
"join_type": "inner"
}
],
"limit": 1,
"offset": 1,
"order_by": {
"columns": [
"<string>"
],
"direction": "asc"
}
}
},
"expressions": [
{
"expression": {
"name": "<string>",
"type": "column"
},
"alias": "<string>"
}
],
"filter_conditions": [
{
"column": "<string>",
"operator": "=",
"value": "<string>",
"and_filter": [
"<unknown>"
],
"or_filter": [
"<unknown>"
]
}
],
"group_by": {
"columns": [
"<string>"
],
"having": {
"column": "<string>",
"function": "SUM",
"operator": "=",
"type": "aggregate",
"value": "<string>"
}
},
"joins": [
{
"condition": {
"left_column": "<string>",
"right_column": "<string>",
"type": "column_equals"
},
"table": "search_queries",
"join_type": "inner"
}
],
"limit": 1,
"offset": 1,
"order_by": {
"columns": [
"<string>"
],
"direction": "asc"
}
}'This route allows you to view the analytics for a dataset using a structured query.
curl --request POST \
--url https://api.trieve.ai/api/analytics \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TR-Dataset: <tr-dataset>' \
--data '{
"columns": [
{
"name": "<string>",
"aggregation": "SUM",
"alias": "<string>",
"distinct": true
}
],
"table": "search_queries",
"cte_query": {
"alias": "<string>",
"query": {
"columns": [
{
"name": "<string>",
"aggregation": "SUM",
"alias": "<string>",
"distinct": true
}
],
"table": "search_queries",
"expressions": [
{
"expression": {
"name": "<string>",
"type": "column"
},
"alias": "<string>"
}
],
"filter_conditions": [
{
"column": "<string>",
"operator": "=",
"value": "<string>",
"and_filter": [
"<unknown>"
],
"or_filter": [
"<unknown>"
]
}
],
"group_by": {
"columns": [
"<string>"
],
"having": {
"column": "<string>",
"function": "SUM",
"operator": "=",
"type": "aggregate",
"value": "<string>"
}
},
"joins": [
{
"condition": {
"left_column": "<string>",
"right_column": "<string>",
"type": "column_equals"
},
"table": "search_queries",
"join_type": "inner"
}
],
"limit": 1,
"offset": 1,
"order_by": {
"columns": [
"<string>"
],
"direction": "asc"
}
}
},
"expressions": [
{
"expression": {
"name": "<string>",
"type": "column"
},
"alias": "<string>"
}
],
"filter_conditions": [
{
"column": "<string>",
"operator": "=",
"value": "<string>",
"and_filter": [
"<unknown>"
],
"or_filter": [
"<unknown>"
]
}
],
"group_by": {
"columns": [
"<string>"
],
"having": {
"column": "<string>",
"function": "SUM",
"operator": "=",
"type": "aggregate",
"value": "<string>"
}
},
"joins": [
{
"condition": {
"left_column": "<string>",
"right_column": "<string>",
"type": "column_equals"
},
"table": "search_queries",
"join_type": "inner"
}
],
"limit": 1,
"offset": 1,
"order_by": {
"columns": [
"<string>"
],
"direction": "asc"
}
}'The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid.
JSON request payload to filter the graph
Represents a complete Analytics query with parameters
search_queries Show child attributes
Represents a complete ClickHouse query with parameters
Show child attributes
search_queries Complex expressions to select
Show child attributes
WHERE clause conditions
Show child attributes
=, !=, <>, >, <, >=, <=, like, not like, in, not in, is null, is not null Show child attributes
Show child attributes
Represents a GROUP BY clause
Show child attributes
Structured HAVING condition
Show child attributes
SUM, COUNT, AVG, MIN, MAX =, !=, <>, >, <, >=, <=, like, not like, in, not in, is null, is not null aggregate Tables to join with
Show child attributes
search_queries Represents the type of join between tables
inner, left, right, full, cross, anti LIMIT clause
x >= 0OFFSET clause
x >= 0Complex expressions to select
WHERE clause conditions
Show child attributes
=, !=, <>, >, <, >=, <=, like, not like, in, not in, is null, is not null Show child attributes
Show child attributes
Represents a GROUP BY clause
Show child attributes
Structured HAVING condition
Show child attributes
SUM, COUNT, AVG, MIN, MAX =, !=, <>, >, <, >=, <=, like, not like, in, not in, is null, is not null aggregate Tables to join with
Show child attributes
search_queries Represents the type of join between tables
inner, left, right, full, cross, anti LIMIT clause
x >= 0OFFSET clause
x >= 0The analytics for the dataset
Was this page helpful?