Skip to content
Streamkap
Esc
navigateopen⌘Jpreview

Execute SQL query against Kafka topics

Parse and execute a SQL query against a Kafka topic.

POST/topics/query
Authorization
AuthorizationBearer token · headerrequired
Request body
requiredapplication/json
sqlstringrequired

SQL query string (e.g., SELECT * FROM topic_name WHERE ... LIMIT 10)

min length 1 · max length 10000
max_time_secondsinteger

Maximum execution time in seconds before the query is terminated

min 1 · max 120 · default: 30
Responses
200

Successful Response

columnsstring[]

Column names in the result set

rowsobject[]

Result rows as dicts

metadataKafkaSqlQueryResultMetadata

Metadata about query execution for the results panel.

Show properties
records_scannedinteger
default: 0
records_matchedinteger
default: 0
partitions_scannedinteger[]
execution_time_msnumber
default: 0
terminated_bystring

limit, max_time, max_bytes, or end_of_topic

default: ""
bytes_scannedinteger
default: 0
topicstring

The topic that was queried

default: ""
errorstring | any

Error message if the query failed

Show properties
Any of:
string
string
any
any
422

Validation Error

detailValidationError[]
Show properties
Array of ValidationError
locstring | integer[]required
Show properties
Array of string | integer
Any of:
string
string
integer
integer
msgstringrequired
typestringrequired
inputany
ctxobject
Request
curl -X POST "https://api.streamkap.com/topics/query" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "sql": "string",
  "max_time_seconds": 30
}'
Response
{
  "columns": [
    "string"
  ],
  "rows": [
    {}
  ],
  "metadata": {
    "records_scanned": 0,
    "records_matched": 0,
    "partitions_scanned": [
      0
    ],
    "execution_time_ms": 0,
    "terminated_by": "",
    "bytes_scanned": 0,
    "topic": ""
  },
  "error": "string"
}