Error Handling

Bad Request - This error should be treated manually, some parameters of your req in the request you invoked.
For example, an error message could look like - "Request failed due to invalid start/end date. Invalid start_date. Historical data for monthly granularity is available as of - 2018-07. You have requested - 2017-01 please pick a later date."
So to fix that error you have to change your requests start date to be later

Internal Error - This error is an unexpected our that occurred in our servers if you encounter this error our recommendation is to embrace a retry policy, you can re-submit your request or use our 'retry' endpoint, to resubmit your request.

Unauthorized - Your API key is invalid, make sure your Similarweb account is active. If you need further help with your API Key reach out to our support team.

Too Many Requests - the limit is 10 requests per second, to avoid this error, do not exceed this limitation (limitation will be live soon).