docs: default polling interval now fits the free plan (api#7235) - #96
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…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_01JKAExynd9zoKwt6rYA66EA
karlwaldman
force-pushed
the
docs/polling-defaults
branch
from
August 23, 2026 12:16
ee5ead7 to
80f2fd6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both recommended intervals in these docs exceeded our own free plan.
EXAMPLES.mdtime.sleep(300)docs/PERFORMANCE_GUIDE.mdtime.sleep(300)Now
1800(30 min = 48/day, fits free) with an inline note to drop to300on Developer and above.Measured, not guessed
Update cadence from the
pricestable over 7 days:BRENT_CRUDE_USDWTI_USD,NATURAL_GAS_USDDIESEL_USD,GASOLINE_USDNothing we publish moves faster than ~2.5 minutes, so a shorter timer returns the same number.
PERFORMANCE_GUIDEnow carries a plan/interval table plus the point that above Developer, extra quota buys more codes, not a faster loop.Flags a real defect where a reader will hit it
get_multiple()issues one HTTP request per code (prices.py:96-99loops overself.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. Tracked as api#7240; the guide now warns rather than letting someone discover it via a402.Not changed, deliberately
PERFORMANCE_GUIDE.md:228time.sleep(1)is explicitly labelled an anti-pattern. Correct as written.Note on the diff
EXAMPLES.mdwas 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
🤖 Generated with Claude Code
https://claude.ai/code/session_01JKAExynd9zoKwt6rYA66EA