While the WorqHat API currently does not enforce strict rate limits, we recommend following these best practices to ensure optimal performance and reliability for all users.
The official WorqHat JavaScript/TypeScript library automatically handles retries for certain types of errors. By default, the library will retry failed requests up to 2 times with an exponential backoff strategy.
You can configure the retry behavior using the maxRetries option:
Copy
// Configure the default for all requests:const client = new Worqhat({ maxRetries: 0, // Disable retries (default is 2)});// Or, configure per-request:await client.db.executeQuery( { query: 'SELECT * FROM users' }, { maxRetries: 5 } // Override with 5 retries for this request);
Requests to the WorqHat API time out after 1 minute by default. You can configure this timeout period to better suit your applicationβs needs.
Copy
// Configure the default timeout for all requests:const client = new Worqhat({ timeout: 20 * 1000, // 20 seconds (default is 1 minute)});// Override timeout per-request:await client.db.executeQuery( { query: 'SELECT * FROM users' }, { timeout: 5 * 1000 } // 5 second timeout for this request);
When a request times out, an APIConnectionTimeoutError is thrown. Note that requests which time out will be retried according to your retry configuration.
The official WorqHat Python library also includes automatic retry functionality similar to the JavaScript library. By default, it retries certain errors 2 times with exponential backoff.
Copy
from worqhat import Worqhat# Configure the default for all requests:client = Worqhat( api_key="YOUR_API_KEY", max_retries=0, # Disable retries (default is 2))# Or, configure per-request:client.with_options(max_retries=5).db.execute_query( query="SELECT * FROM users",)
While we donβt currently enforce strict rate limits, we do monitor API usage patterns to ensure the stability and performance of our platform. If we detect unusual or potentially harmful usage patterns, we may reach out to you to discuss your use case and find a solution that works for everyone.
As our platform grows, we may introduce rate limits to ensure fair usage across all customers. We will provide advance notice of any changes to our API usage policies.