@@ -235,36 +235,26 @@ while True:
235235
236236** Solution:**
237237``` python
238- # Match the interval to your plan AND to how fast the data moves.
238+ # Match the interval to the account limit and how fast the data moves.
239239import time
240240
241241while True :
242242 price = client.prices.get(" WTI_USD" )
243243 print (f " WTI: $ { price.value} " )
244- time.sleep( 1800 ) # 30 min -> 48 requests/day, fits the free plan
245- # Developer and above: 300 (5 minutes )
244+ # Example interval; derive this from current limit/reset metadata.
245+ time.sleep( 1800 )
246246```
247247
248- ** Pick the interval from your plan:**
249-
250- | Plan | Quota | Poll every | Requests/day |
251- | --- | --- | --- | --- |
252- | Free | 50 / day | ** 30 minutes** | 48 |
253- | Developer | 10,000 / month | 5 minutes | 288 |
254- | Starter | 50,000 / month | 5 minutes | 1,440 |
255- | Professional+ | 100,000+ / month | 5 minutes | 2,880 |
256-
257- Polling faster than the data changes cannot return new information. Measured
258- over a week: ` BRENT_CRUDE_USD ` updates about every 2.5 minutes, ` WTI_USD ` and
259- ` NATURAL_GAS_USD ` about every 5, and refined products such as ` DIESEL_USD `
260- about twice a day. Above Developer, extra quota is better spent on more
261- commodity codes than on a shorter timer.
248+ Choose the interval from the current account response and the source timestamps
249+ returned with the data. Polling faster than the source changes cannot return new
250+ information, while a hard-coded schedule can exceed an account's current
251+ allowance when product limits change.
262252
263253⚠️ ** ` get_multiple() ` currently issues one HTTP request per code** , so it
264254consumes quota per commodity rather than per call. Until that is batched
265255(api #7240 ), a loop over ` get() ` and a call to ` get_multiple() ` cost the same.
266- The REST API itself accepts up to 20 codes in a single request that counts
267- once — see the rate-limiting guide if you are close to your quota.
256+ See the rate-limiting guide for the current REST batching contract if you are
257+ close to your quota.
268258
269259** Better Solution (for streamed updates):**
270260``` python
0 commit comments