Skip to content

docs: default polling interval now fits the free plan (api#7235) - #96

Merged
karlwaldman merged 2 commits into
mainfrom
docs/polling-defaults
Aug 23, 2026
Merged

docs: default polling interval now fits the free plan (api#7235)#96
karlwaldman merged 2 commits into
mainfrom
docs/polling-defaults

Conversation

@karlwaldman

Copy link
Copy Markdown
Member

Both recommended intervals in these docs exceeded our own free plan.

file was req/day vs 50/day free
EXAMPLES.md time.sleep(300) 288 5.8× over
docs/PERFORMANCE_GUIDE.md time.sleep(300) 288 5.8× over — and it is the "Solution" block

Now 1800 (30 min = 48/day, fits free) with an inline note to drop to 300 on Developer and above.

Measured, not guessed

Update cadence from the prices table over 7 days:

code new value every
BRENT_CRUDE_USD ~2.5 min
WTI_USD, NATURAL_GAS_USD ~5 min
DIESEL_USD, GASOLINE_USD ~twice a day

Nothing we publish moves faster than ~2.5 minutes, so a shorter timer returns the same number. PERFORMANCE_GUIDE now 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-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. Tracked as api#7240; the guide now warns rather than letting someone discover it via a 402.

Not changed, deliberately

PERFORMANCE_GUIDE.md:228 time.sleep(1) is explicitly labelled an anti-pattern. Correct as written.

Note on the diff

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

🤖 Generated with Claude Code

https://claude.ai/code/session_01JKAExynd9zoKwt6rYA66EA

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d7f27b77-9731-42b9-b205-c9bfae510d92


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

karlwaldman and others added 2 commits August 23, 2026 08:16
…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
karlwaldman force-pushed the docs/polling-defaults branch from ee5ead7 to 80f2fd6 Compare August 23, 2026 12:16
@karlwaldman
karlwaldman merged commit cec8e22 into main Aug 23, 2026
7 checks passed
@karlwaldman
karlwaldman deleted the docs/polling-defaults branch August 23, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant