Rules & Guide lines¶
You have to abide by the signed API-license agreement (Agreement).
In the Agreement there are some important notes about technical implementation.
You must comply to our caching rules
You should keep track of your rate limit to make sure that your implementation works without hitches at all times.
Caching¶
To be able to provide an API, PriceSpy need each client to cache responses to prevent our servers to become overloaded with traffic. With each response from the API, you will see how long you should cache it. You will find this information in the headers section of the response, in the header directive: ”Cache-Control: max-age=n” where n is the number of seconds you must cache the response. You should cache it this long, and you should not cache it longer. A response older than n seconds is considered to be stale and might not show the most current and correct data. Some end-points, such as “search”, will have a cache directive “Cache-control: no-cache, must-revalidate”. You should never cache these responses but always make a new request.
Date: Wed, 29 Jan 2014 14:17:24 GMT
Server: Apache
Vary: Accept
X-RateLimit-Limit: 50000
X-RateLimit-Remaining: 49999
X-RateLimit-Reset: 1391008644
Cache-Control: max-age=900 <---
Expires: 0
X-Powered-By: Luracast Restler v3.0.0rc3
Content-Language: en-US
Keep-Alive: timeout=5, max=300
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/json; charset=utf-8
Date: Wed, 29 Jan 2014 14:24:09 GMT
Server: Apache
Vary: Accept
X-RateLimit-Limit: 500000
X-RateLimit-Remaining: 499988
X-RateLimit-Reset: 1391009006
Cache-Control: no-cache, must-revalidate <---
Expires: 0
X-Powered-By: Luracast Restler v3.0.0rc3
Content-Language: en-US
Content-Length: 172
Connection: close
Content-Type: application/json; charset=utf-8
Rate limit¶
As an API consumer you’ll have a fixed number of request you are allowed in a certain amount of time. You can keep track of your rate limit by observing the response headers. Every response contains three values specific to rate limit: “X-RateLimit-Limit” (Limit), “X-RateLimit-Remaining” (Remaining), “X-RateLimit-Reset” (Reset).
Limit is your total rate limit, and should be specified in the Agreement.
Remaining tells you how many more requests you can make, before reaching the limit
Reset is a timestamp, specifying the time when Remaining will be reset to Limit.
Date: Wed, 29 Jan 2014 14:24:09 GMT
Server: Apache
Vary: Accept
X-RateLimit-Limit: 500000 <---
X-RateLimit-Remaining: 499988 <---
X-RateLimit-Reset: 1391009006 <---
Cache-Control: no-cache, must-revalidate
Expires: 0
X-Powered-By: Luracast Restler v3.0.0rc3
Content-Language: en-US
Content-Length: 172
Connection: close
Content-Type: application/json; charset=utf-8
It’s important to note that Limit is a soft limit. We won’t deny access to the API if you reach your limit. The Limit should be set reasonably and sufficient for your needs at the time the Agreement was signed. If you reach your limit because of an honest mistake while developing, or if you experience an unusual spike in usage of your implementation we will do nothing about it except inform you that the Limit was reached. If you constantly reach your Limit even when caching each response as required, you probably have had a very successful implementation of our API. Congratulations to you. To remedy this situation we can agree upon a higher Limit in a revised Agreement.