Query Services Overview
Data Cloud provides multiple ways to query your data through Query Services. This section provides an overview of the available APIs and their capabilities.
- Synchronous API for data extraction
- Supports pagination with limit and offset
- Suitable for browser-based clients and interactive querying
- Query API V1 Documentation
- Supports ANSI standard SQL
- Returns results as an array of records
- Ideal for large volume data reads and external application integration
- Supports data streams, profile, engagement, and unified data model objects
- Query API V2 Documentation
- Get Query V2 Documentation
For information about HTTP status codes and error handling, see Query Services Status Codes.
We recommend including key qualifier fields in all table joins for queries submitted through the Query API V2. Use the COALESCE() function to get a null-safe join. When key qualifiers aren't configured on data lake object fields, the value for the key qualifier field is null. In such cases, use the COALESCE() function to achieve the required results. This sample query demonstrates the usage of the COALESCE() function:
- SQL Support: Both V1 and V2 APIs support SQL queries against your Data Cloud data
- Pagination: V1 API supports limit and offset for pagination
- Batch Processing: V2 API supports batch processing for large datasets
- Metadata: Access to field types, relationships, and data model information
- Performance: Optimized for different use cases (interactive vs. batch processing)
-
Choose the appropriate API version based on your needs:
- Use V1 for interactive queries and browser-based applications
- Use V2 for large volume data reads and external application integration
-
Review the API documentation for your chosen version:
-
Familiarize yourself with the status codes for error handling
-
Start with simple queries and gradually build up to more complex ones
- Use appropriate pagination for large result sets
- Implement proper error handling using status codes
- Consider using V2 API for large volume data reads
- Use V1 API for interactive queries and browser-based applications
- Monitor query performance and optimize as needed