SuperAPI AI Directory

linkfox-amazon-store-feeds

Office & productivity

View repository

Updated 10-15 12:33

About this skill

Amazon store Feeds

This skill and linkfox-amazon-store-auth and others belong to the Amazon Store series: it depends on linkfox-amazon-store-auth store selection (sellerId+region); directly POST /spApi/developerProxy pass in sellerId+region, and the server parses the token (do not pass amzAccessToken, unless for compatibility with legacy calls). Forward GET / POST / DELETE。

How to call

  • API endpoint:POST /spApi/developerProxy(different operations are distinguished by the request body; for complete parameters/responses/error codes see references/api.md)
  • Python script:python scripts/<脚本名>.py '<JSON 参数>' [--inline](for available scripts see the script overview above)
  • Cost constraints: this tool consumes compute; on failure/empty results, do not automatically switch keywords, paginate, or probe continuously; if you need to continue searching, first explain to the user that it will incur additional consumption.

Output strategy (default script behavior):

  • Alwayswrite the complete response to <cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-amazon-store-feeds-<timestamp>.json(<cwd> is the working directory when the script runs, which in Claude Code is the current project directory;<session> is taken from the environment variable SESSION_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 saving to disk, print the complete JSON to stdout
  • Response body > 8 KB: after saving 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 --inline to force full printing to stdout (also saved to disk)

Data reading suggestions: first look at the summary to determine whether it is sufficient; when specific fields are needed, prefer using jqorConvertFrom-Json to extract as needed from the saved json file, avoiding bringing the entire JSON into the context.

Resolve authentication and compute issues

When the following abnormal situations occur, use references/onboarding.md to guide problem resolution:

Abnormal situations

  • API Key not configured: the environment variable is not configured LINKFOX_AGENT_API_KEY, and LINKFOXAGENT_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/plan expired/recharge required/please recharge", or similar meaning.

Official reference index

Capability Documentation
createFeedDocument createFeedDocument
getFeedDocument getFeedDocument
createFeed createFeed
getFeed getFeed
getFeeds getFeeds
cancelFeed cancelFeed

Prerequisites

  1. Depends on linkfox-amazon-store-auth; when running python scripts/check_auth_dependency.py,exit 42 , the authorization skill must be installed first.
  2. The application must have the Feeds related role;feedType must match the uploaded file format (see the Amazon Feed Type Values documentation).

Typical workflow

  1. create_feed_document.py → get feedDocumentId and url(upload URL).
  2. upload_feed_document.py → upload the feed file to url PUT (does not go through developerProxy)。
  3. create_feed.py → pass in inputFeedDocumentId、feedType、marketplaceIds。
  4. get_feed.py / get_feeds.py → poll processingStatus(such as IN_QUEUE, IN_PROGRESS, DONE, FATAL).
  5. After processing is complete, use get_feed_document.py to download resultFeedDocumentId Corresponding document (then download the result file yourself using the returned URL).

Current Capabilities

Capability path method Script
createFeedDocument feeds/2021-06-30/documents POST create_feed_document.py
getFeedDocument feeds/2021-06-30/documents/{feedDocumentId} GET get_feed_document.py
createFeed feeds/2021-06-30/feeds POST create_feed.py
getFeed feeds/2021-06-30/feeds/{feedId} GET get_feed.py
getFeeds feeds/2021-06-30/feeds GET get_feeds.py
cancelFeed feeds/2021-06-30/feeds/{feedId} DELETE cancel_feed.py
Upload document content URL returned by createFeedDocument PUT upload_feed_document.py

Shared modules:_spapi_feeds_common.py。


Scripts examples

export LINKFOXAGENT_API_KEY="<your-key>"

python scripts/create_feed_document.py '{"sellerId":"A1...","region":"NA","contentType":"text/tab-separated-values; charset=UTF-8"}'

python scripts/upload_feed_document.py '{"uploadUrl":"<from createFeedDocument>","contentType":"text/tab-separated-values; charset=UTF-8","filePath":"./inventory.tsv"}'

python scripts/create_feed.py '{"sellerId":"A1...","region":"NA","feedType":"POST_FLAT_FILE_INVLOADER_DATA","marketplaceIds":["ATVPDKIKX0DER"],"inputFeedDocumentId":"<feedDocumentId>"}'

Display Rules

  1. First see developerProxy.errcode / httpStatus; createFeedDocument is usually 201, createFeed is usually 202。
  2. getFeeds Pagination: only use the previous page's nextToken as the next request's paginationToken parameter name on the Amazon side is nextToken(script field name nextToken)。
  3. upload failure is unrelated to the SP-API gateway; check whether uploadUrl has expired, whetherContent-Type is consistent with createFeedDocument.
  4. The gateway path whitelist must include the feeds/2021-06-30/ prefix.

Important Limitations

  • This skill does notreplace Amazon-side feed file schema validation;feedType, TSV/XML formats are subject to the official specifications.
  • Download the getFeedDocument returned by url content requires a separate HTTP GET (similar to upload, not through developerProxy).
  • 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 interfaces of the store More than 2 times within 60 seconds: 5 minutes; more than 4 times within 10 minutes: 30 minutes Stop calling this 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, and if unavailable, follow the durations in the table.
  • For 450/453/454, you must first correct the parameters, authorization, or resource identifier; after cooldown, retry cautiously at most once; if triggered again, stop calling. During 453, stop all SP-API calls for that store.
  • Keep existing task IDs such as reportId、feedId ; when the result of a write operation is uncertain, query the status first and do not directly replay.
  • First explain store protection to the user, then give the reason, handling, and waiting 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 {waiting time}; this does not indicate account suspension, nor is it a plan or computing power limit." Do not only say "LinkFox rate limiting" or "server busy".

Computing power consumption rules

Does not consume compute power.

Feedback: skillName:linkfox-amazon-store-feeds。


More cross-border skills:LinkFox Skills