Commit 46df27b
docs: default polling interval now fits the free plan (api#7235, api#7240)
Both recommended intervals in the SDK docs exceeded our own free plan:
EXAMPLES.md time.sleep(300) -> 288/day = 5.8x the 50/day allowance
PERFORMANCE_GUIDE.md time.sleep(300) -> same, and it is the "Solution" block
Defaults are now 1800 (30 min = 48 requests/day, fits free), with an inline
note to drop to 300 on Developer and above.
PERFORMANCE_GUIDE gains a plan/interval table and the measured update cadence
(BRENT ~2.5 min, WTI and natural gas ~5 min, refined products ~twice a day,
from the prices table over 7 days), so the interval is chosen from evidence
rather than habit. Above Developer, extra quota is better spent on more codes
than a shorter timer - the data has no more resolution to give.
Also flags api#7240 where a reader will trip over it: get_multiple() currently
issues one HTTP request PER CODE (prices.py:96-99 loops over self.get), so it
costs the same as a manual loop while the REST API accepts 20 codes in one
request that counts once. Verified against production today.
NOT changed after reading the context:
PERFORMANCE_GUIDE.md:228 time.sleep(1) - explicitly labelled an anti-pattern
EXAMPLES.md was patched in binary to preserve its 640 CRLF line endings; a
formatter had otherwise normalised the whole file and turned an 8-line change
into a 1,286-line diff.
Refs api#7235, api#7240
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JKAExynd9zoKwt6rYA66EA1 parent 8c5fee7 commit 46df27b
2 files changed
Lines changed: 30 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
459 | | - | |
460 | | - | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
461 | 465 | | |
462 | 466 | | |
463 | 467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
| 245 | + | |
245 | 246 | | |
246 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
247 | 269 | | |
248 | 270 | | |
249 | 271 | | |
| |||
0 commit comments