Overview
Backend Services Only: This Fetch API implementation is designed for server-side applications and backend services. For client-side applications, use the Node.js SDK or Python SDK instead to ensure proper API key security.
π― What is SnakeQuery?
SnakeQuery transforms natural language into structured data queries using AI. Instead of writing complex filtering, mapping, and aggregation logic, simply describe what you want in plain language.π Quick Start
Get Your API Key
- Visit SnakeQuery Dashboard
- Sign up or log in
- Navigate to Setup section
- Copy API key
Basic Usage
π Structured Responses with Schema
For production applications, define response schemas to ensure consistent, type-safe results:π Querying External APIs
Query data from any REST API endpoint by providing a URL instead of direct data:π§ Environment Setup
Environment Variables
For production backend applications, store your API key securely using environment variables:Reusable Query Function
Create a reusable function for your application:π― Common Use Cases
1. E-commerce Product Filtering
2. Data Analytics Dashboard
3. User Management
β οΈ Error Handling
HTTP Status Codes
Network Error Handling
π Security Best Practices
API Key Protection
Backend Security
Server-Side Only: This implementation should only be used in secure server environments where API keys cannot be exposed to end users.
β‘ Performance Tips
- Use specific queries: βFind top 10 productsβ vs βShow all productsβ
- Define schemas: Structured responses are faster and more reliable
- Cache results: Store frequently used query results locally
- Batch related queries: Combine multiple questions into one query
π Next Steps
- Recommended: Use Node.js SDK for easier server-side integration
- Explore Python SDK for data science and backend workflows
- Learn Schema Building for structured responses
- Set up proper backend proxy endpoints for frontend applications
π API Reference
Core Endpoint
POSThttps://app.snakequery.com/api/query
Headers
Header | Value | Required |
---|---|---|
Content-Type | application/json | Yes |
Authorization | Bearer {api_key} | Yes |
Request Body
Response Format
HTTP Status Codes
Code | Description |
---|---|
200 | Success |
400 | Bad Request - Invalid query or parameters |
401 | Unauthorized - Invalid or missing API key |
402 | Payment Required - Insufficient credits |
429 | Rate Limit Exceeded |
500 | Internal Server Error |
504 | Gateway Timeout - Request took too long |
Error Response Format
π¬ Getting Help
- Check the complete API Documentation
- Open an issue on GitHub
- Contact support for enterprise solutions