Query the dataset
Querying Data
Query Data
Performs a query against a specified dataset with the given parameters
POST
Query the dataset
Core Concepts
Datasets
Each dataset in DataGyro has a unique identifier (dataset_id). You’ll need to specify which dataset you want to query in your request.
Query Parameters
query_string: The search term or phrase you want to find in the datasetdataset_id: The unique identifier for the dataset you want to querylimit: Maximum number of results to return (default: 10)use_smaller_model: Option to use a smaller model for faster processing (default: false)
Example Request
Accept: text/event-stream header and handle the streaming response appropriately.
Response Format
The query endpoint returns a Server-Sent Events (SSE) stream that provides real-time updates during query processing. Each event contains adata field with JSON content.
Stream Event Types
The SSE stream returns four types of events in sequence:1. Thoughts Event
Provides insights into the query processing logic:2. SQL Event
Contains the generated SQL query:3. Results Event
Contains the actual query results:4. Close Event
Indicates the stream has completed:Consuming the SSE Stream
To consume the SSE stream in JavaScript:Error Handling
The API may return the following error responses:400 Bad Request: Invalid parameters were provided401 Unauthorized: Invalid or missing API key404 Not Found: The specified dataset was not found500 Server Error: An internal server error occurred
Authorizations
API key for authentication
Body
application/json
The search query to execute against the dataset
Example:
"Engineers"
Identifier for the dataset to query
Example:
"118"
Maximum number of results to return
Required range:
1 <= x <= 100Option to use a smaller model for faster but potentially less accurate results
Response
Server-Sent Events stream with query processing updates
SSE stream with events containing JSON data