docs: document multi-code batching — 20 codes, one request (api#7240) - #73
Merged
Conversation
The API accepts up to 20 comma-separated commodity codes in a single request that counts ONCE against quota. This SDK has always supported it and the README never said so — zero mentions of batching, comma-separated codes, or the cap. Users could not discover a 20x quota saving. On the free plan that is the difference between 50 code-reads a day and 1,000. Verified by running it, not by reading the source: node against the live API -> 3 prices in ONE request Also documents the two failure modes a caller will actually hit: 21+ codes returns 400 "Too many commodity codes requested (max: 20, requested: N)", and an unrecognised code returns 400 with a "did you mean" suggestion. NOT a code change. Unlike the Python SDK (api#7240), this client has no per-code loop — it passes by_code straight through, so batching already worked. Python had a broken batch helper; the other three had no affordance at all. Refs api#7240, api#7235 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JKAExynd9zoKwt6rYA66EA
|
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 |
CI rejected the first version: Error: README.md: fixed demo rate "50 requests a day" scripts/validate-storefront-claims.mjs (and its siblings) forbid plan specifics in an SDK README — "free tier", fixed quota windows, and fixed request rates. That is deliberate and correct: plans change, SDKs release on their own cadence, and a stale allowance baked into a published package is worse than none at all. It is also exactly the failure this whole thread is about. The docs site published "200 requests per month" for 17 days after the plan became 50/day (api#7235). I then wrote the new number into three SDK READMEs that release independently — the same mistake, one layer down. The guard caught it; nothing caught the docs site. Rewritten to state the mechanism and the RATIO, which is true regardless of plan: twenty codes in one call stretches an allowance twenty times. Plan specifics now live behind a link to the rate-limiting guide, which is where they can be kept current. Kept: the 20-code cap and both 400 responses — those are API contract, not plan claims. Verified locally before pushing: node scripts/validate-storefront-claims.mjs -> validated 36 Node public surfaces, pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JKAExynd9zoKwt6rYA66EA
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.
The API accepts up to 20 comma-separated commodity codes in one request that counts once against quota. This SDK has always supported that — and the README never said so.
Grepped all three non-Python SDK READMEs for any mention of batching, comma-separated codes, or the cap: zero hits in each. Users could not discover a 20× quota saving. On the free plan that is the difference between 50 code-reads a day and 1,000.
Verified by running it, not by reading the source
Node, against the live API with a real key:
Also confirmed the comma survives URL encoding — both the raw
,and%2Cforms return 200 withdata.prices[].Not a code change
Unlike the Python SDK (api#7240, fixed and released as 1.13.0), this client has no per-code loop. It passes
by_codestraight through, so batching already worked.The split is worth naming: Python had a broken batch helper; Go, Node and PHP had no affordance at all. Different defect, same cost to the user.
What the section covers
400over 20 codes, and400with a "did you mean" for an unrecognised codeRefs api#7240, api#7235
🤖 Generated with Claude Code
https://claude.ai/code/session_01JKAExynd9zoKwt6rYA66EA