This skill and linkfox-amazon-store-auth、linkfox-amazon-store-report、linkfox-amazon-store-listings both belong to the Amazon Store series: depends on linkfox-amazon-store-auth store selection (sellerId+region); directly POST /spApi/developerProxy pass in sellerId+region, the server parses the token (do not pass amzAccessToken, unless for compatibility with legacy calls). Forward upstream GET or POST。
Invocation Method
- API Endpoint:
POST /spApi/developerProxy(different operations are distinguished via the request body; for complete parameters/responses/error codes seereferences/api.md) - Python Script:
python scripts/<脚本名>.py '<JSON 参数>' [--inline](available scripts are listed in the script overview above) - Cost Constraints: This tool consumes compute; on failure/empty results, do not automatically switch keywords, paginate, or repeatedly probe; if continued retrieval is needed, first explain to the user that additional consumption will be incurred.
Output Strategy (Default Script Behavior):
- Alwayswrite the complete response to
<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/<skill-name>-<timestamp>.json(<cwd>is the working directory when the script is executed, which in Claude Code is the current project directory;<session>is taken from the environment variableSESSION_ID, automatically aggregated according to the user's task;writing to /tmp is prohibited, if the current directory is not writable, report an error) - Response body ≤ 8 KB: after writing to disk, print the complete JSON to stdout
- Response body > 8 KB: after writing to disk, stdout outputs only a summary (top-level fields, common counts such as
total/costToken, length of the largest list field + first 3 samples) - Add
--inlineto force full printing to stdout (also written to disk)
Data Reading Recommendations: First look at the summary to determine whether it is sufficient; when specific fields are needed, prefer using jqorConvertFrom-JsonorConvertFrom-Json to extract on demand from the saved json file, avoiding bringing the entire JSON into context.
Resolve Authentication and Compute Issues
When the following abnormal situations occur, use references/onboarding.md to guide resolution:
Abnormal Situations
- API Key not configured: The environment variable is not configured with
LINKFOX_AGENT_API_KEY, nor isLINKFOXAGENT_API_KEY。 - Response 401 or 402 status code
- Response indicates insufficient compute or balance: The message contains "insufficient compute balance/insufficient billing/insufficient balance/quota exceeded/insufficient balance/package expired/recharge required/please recharge", or content with similar meaning.
Official Reference Index
| Capability | Documentation |
|---|---|
| getPricing | getPricing |
| getCompetitivePricing | getCompetitivePricing |
| getListingOffers | getListingOffers |
| getItemOffers | getItemOffers |
| getItemOffersBatch | getItemOffersBatch |
| getListingOffersBatch | getListingOffersBatch |
| getFeaturedOfferExpectedPriceBatch | getFeaturedOfferExpectedPriceBatch |
| getCompetitiveSummary | getCompetitiveSummary |
Prerequisites (must read first)
This skill depends on linkfox-amazon-store-auth。
- Run
python scripts/check_auth_dependency.py; if exit code 42 and stderr containsDEPENDENCY_MISSING:, please install firstlinkfox-amazon-store-auth。 - Do notbypass the dependency within this skill to implement authorization or token logic.
Current Capabilities (Script Overview)
| Capability | developerProxy path(Key Points) |
Script |
|---|---|---|
| getPricing | products/pricing/v0/price + Query |
get_pricing.py |
| getCompetitivePricing | products/pricing/v0/competitivePrice + Query |
get_competitive_pricing.py |
| getListingOffers | products/pricing/v0/listings/{sku}/offers + Query |
get_listing_offers.py |
| getItemOffers | products/pricing/v0/items/{asin}/offers + Query |
get_item_offers.py |
| getItemOffersBatch | batches/products/pricing/v0/itemOffers,POST JSON body |
post_item_offers_batch.py |
| getListingOffersBatch | batches/products/pricing/v0/listingOffers,POST JSON body |
post_listing_offers_batch.py |
| getFeaturedOfferExpectedPriceBatch | batches/products/pricing/2022-05-01/offer/featuredOfferExpectedPrice,POST |
post_featured_offer_expected_price_batch.py |
| getCompetitiveSummary | batches/products/pricing/2022-05-01/items/competitiveSummary,POST |
post_competitive_summary_batch.py |
Batch script (post_*_batch.py) in default mode will, as required by Amazon,assemblesub-requests; for advanced usage, you can set useAmazonRequestShape: true, directly pass requests as the official raw array (still subject to the item count limit). Shared logic is in scripts/_spapi_pricing_common.py(for import by scripts in the same directory only, not a standalone CLI).
Quick Parameters (Summary)
- getPricing / getCompetitivePricing:
sellerId、region、marketplaceId(ormarketplaceIdsto take the first),itemType、asinsorskus(≤20); getPricing additionally hasitemCondition、offerType; getCompetitivePricing additionally hascustomerType。 - getListingOffers / getItemOffers:
sku+path orasin+path;itemConditionis required; optionalcustomerType。 - Item / Listing Offers Batch:
requestsarray, each item defaults to a simplified object (seereferences/api.md);1~20 items (the FOEP batch script is up to 40 items). - getCompetitiveSummary batch: each item requires
asin、marketplaceId、includedData(non-empty string array); optionallowestPricedOffersInputs。 - getFeaturedOfferExpectedPriceBatch: each item requires
marketplaceId、sku、segment(object, structure per the official specification).
Scripts
get_pricing.py·get_competitive_pricing.py·get_listing_offers.py·get_item_offers.pypost_item_offers_batch.py·post_listing_offers_batch.py·post_featured_offer_expected_price_batch.py·post_competitive_summary_batch.pycheck_auth_dependency.py·_spapi_pricing_common.py(internal module)
export LINKFOXAGENT_API_KEY="<your-key>"
python scripts/get_item_offers.py '{"sellerId":"A1...","region":"NA","asin":"B0...","marketplaceId":"ATVPDKIKX0DER","itemCondition":"New"}'
python scripts/post_item_offers_batch.py '{"sellerId":"A1...","region":"NA","requests":[{"asin":"B0...","marketplaceId":"ATVPDKIKX0DER","itemCondition":"New"}]}'
Display Rules
MarketplaceId(singular) and Listings'marketplaceIdsmust not be mixed up.- First check the gateway
errcode/httpStatus, then parse the parsing fields corresponding to each script (such asitemOffers、itemOffersBatch、competitiveSummary, etc.). - POST type interfaces:
stdoutcontainsrequestBody(the Amazon request body assembled by the script), for troubleshooting. - Whitelist: except for
products/pricing/..., batch paths start withbatches/products/pricing/...;1005 requires the backend to allow the corresponding prefix. - Each interface's Usage plan differs (especially 2022-05-01 batch about 0.033 req/s), note 429。
Important Limitations
- Permissions:Product Pricing and related roles; some 2022-05-01 capabilities may have additional in-app configuration requirements, subject to Amazon.
- FOEP batch:
segmentmust conform to the official model; the item count limit is validated by the script according to 40 (consistent with the documentation's "up to 40"). - The return structure is subject to the Amazon schema; see
references/api.md。
Amazon SP-API Interface Protection and Retry Guidelines
When the same store continuously receives 400, 403, 404, or 429 from Amazon SP-API, the gateway returns 450, 453, 454, or 459 and briefly cools down. These custom status codes are not native Amazon statuses and do not indicate account suspension; the purpose is to avoid continuous anomalies or high-frequency calls increasing store risk.
| Status and message | Scope | Trigger and cooldown | Handling |
|---|---|---|---|
450:400,请求异常,请优化您的参数 |
Store+interface | More than 3 times within 60 seconds: 5 minutes; more than 4 times within 10 minutes: 20 minutes | Stop retrying with the original parameters, check required fields, marketplace, ID, date, and request body |
453:403,店铺未授权,请先授权 |
All store interfaces | More than 2 times within 60 seconds: 5 minutes; more than 4 times within 10 minutes: 30 minutes | Stop calling for that store, check authorization, permissions, store ownership, and region |
454:404,资源不存在,请优化您的参数 |
Store+interface | More than 3 times within 60 seconds: 5 minutes; more than 4 times within 10 minutes: 30 minutes | Confirm the resource ID, owning store/site, resource status, and interface path |
459:429限流中,请降低频率 |
Store+interface | First time: 15 seconds; more than 2 times within 2 minutes: 30 seconds; more than 4 times within 3 minutes: 2 minutes | Reduce concurrency, pagination, and polling frequency and back off progressively |
- Immediately stop automatic or concurrent retries; do not bypass protection by switching scripts or repeatedly creating tasks; prioritize following
retryAfter、blockedUntil, if not present, follow the duration description in the table. - For 450/453/454, you must first correct the parameters, authorization, or resource identifier, and after the cooldown retry cautiously at most once; if triggered again, stop calling. During 453, stop all SP-API for that store.
- Keep existing
reportId、feedIdand other task IDs; when the result of a write operation is uncertain, query the status first and do not directly replay it. - First explain store protection to the user, then give the reason, handling, and wait time. You may reply: "To protect the security of your Amazon store, it has been detected that Amazon SP-API continuously returned {reason}, and a brief protection period is currently in effect. Please first {handling action}, and try again after an estimated {wait time}; this does not mean the account is banned, nor is it a plan or computing power limit." Do not only say "LinkFox rate limiting" or "server busy."
Computing power consumption rules
No computing power is consumed.
Feedback: see references/api.md,skillName:linkfox-amazon-store-pricing。
More cross-border skills:LinkFox Skills