Skip to main content
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 dataset
  • dataset_id: The unique identifier for the dataset you want to query
  • limit: Maximum number of results to return (default: 10)
  • use_smaller_model: Option to use a smaller model for faster processing (default: false)

Example Request

Note: The endpoint returns a Server-Sent Events stream, so make sure to include the 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 a data 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 provided
  • 401 Unauthorized: Invalid or missing API key
  • 404 Not Found: The specified dataset was not found
  • 500 Server Error: An internal server error occurred
Error responses will include an error message and code:

Authorizations

apikey
string
header
required

API key for authentication

Body

application/json
query_string
string
required

The search query to execute against the dataset

Example:

"Engineers"

dataset_id
string
required

Identifier for the dataset to query

Example:

"118"

limit
integer
default:10

Maximum number of results to return

Required range: 1 <= x <= 100
use_smaller_model
boolean
default:false

Option 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