API Rate Limits
The Site Search API is rate limited to prevent abuse.
The limits are high enough that typical use should rarely be rate limited.
Rate limits are calculated by requests over an hour.
JSONP and Rate Limiting
Most Site Search customers use JSONP for autocomplete and search results.
It is unlikely they will be rate limited, unless a user is abusing the service.
Rate Limiting Example
Requests that have been rate limited will respond with HTTP 429 Too Many Requests
.
HTTP 429
is a new - but very useful - status code proposed by RFC 6585.
curl -i -XGET 'https://search-api.swiftype.com/api/v1/public/engines/suggest.json?callback=foo&q=search&engine_key=your_engine_key'
HTTP/1.1 429
Content-Type: application/json; charset=utf-8
Content-Length: 32
{ "error": "Rate limit exceeded." }
Rate Limiting Headers
There are two response headers which provide a guideline towards the rate limit:
X-RateLimit-Limit: xxxx
X-RateLimit-Remaining: xxxx
The header values and their refresh interval vary depending on your plan and which endpoint you are sending requests against.
Due to a variety of network and API influences, these headers are for guidance and are not an exact measure.
Values are expressed in 60 minute intervals.
Rate Limit Mitigation
If your application is being affected by rate limiting, please wait a couple of hours and then try again.
If the problem persists, contact support@swiftype.com for assistance.
Stuck? Looking for help? Contact support or check out the Site Search community forum!