SuperAPI AI Directory

zach-lingxing-openapi-client

Agents & models

View repository

Updated 10-16 09:44

About this skill

Direct local connection disabled / fixed egress mode available: Due to IP whitelist restrictions on the Lingxing OpenAPI, the local environment cannot access it directly. If a fixed egress gateway has been deployed and EIP has been added to the whitelist, this Skill can continue to be used. Before deployment, when Amazon business data is needed, please prioritize switching to Amazon SP-API (MCP: amazon-api)。

This public version of the Skill is self-contained and does not depend on any private workspace files, internal protocols, or team manuals.

Lingxing OpenAPI client foundation

Core features

  1. Unified management of access_token acquisition and renewal
  2. Generate according to official rules sign
  3. Encapsulate GET/POST business requests
  4. Cache key official documentation locally
  5. Run a minimal smoke test to confirm the SellerLists -> StoreSales -> Orderlists -> promotionListingList pipeline is available
  6. Provide a shared service layer for the Lingxing MCP and other skills

Environment variables

Variable name Required Description
LINGXING_APP_ID Yes Lingxing Open API App ID
LINGXING_APP_SECRET Yes Lingxing Open API App Secret
LINGXING_TOKEN_CACHE_FILE No token cache file path, default runtime/lingxing/token_cache.json
LINGXING_DOC_ACCESS_KEY No Documentation key used when syncing documentation

Script Directory

Scripts are located in skills/zach-lingxing-openapi-client/scripts/:

  • lingxing_client.py: compatibility entry point, actually reuses lib/lingxing_openapi/client.py
  • timezone_map.py: compatibility entry point, actually reuses lib/lingxing_openapi/timezones.py
  • sync_docs.py: automatically discovers and syncs Amazon-related read-only documentation from the official _sidebar.md to references/openapi_docs/
  • smoke_check.py: minimal pipeline smoke test

Shared code is located in lib/lingxing_openapi/:

  • client.py: authentication, renewal, signing, unified request encapsulation
  • services.py: business-oriented encapsulation for stores, sales, orders, promotions, etc.
  • promotions.py: promotion tag and window normalization
  • errors.py: unified errors and prompts
  • mcp.py: MCP tool registration, stdio/HTTP transport layer

Local documentation cache

Sync command:

python3 skills/zach-lingxing-openapi-client/scripts/sync_docs.py

Sync results will be written to:

skills/zach-lingxing-openapi-client/references/openapi_docs/

It will retain the existing 12-page compatibility filenames and automatically expand to more Amazon-related read-only pages. Compatibility pages include:

  • GetToken
  • RefreshToken
  • SellerLists
  • AllMarketplace
  • StoreSales
  • AsinDailyLists
  • Orderlists
  • promotionListingList
  • promotionalActivitiesSecKillList
  • promotionalActivitiesManageList
  • promotionalActivitiesVipDiscountList
  • promotionalActivitiesCouponList

Usage

Scenario 1: Reuse for other skills

Import directly in a Python script:

from lib.lingxing_openapi import LingxingOpenAPIClient, LingxingOpenAPIService

Scenario 2: Sync local documentation

export LINGXING_DOC_ACCESS_KEY="你的文档密钥"
python3 skills/zach-lingxing-openapi-client/scripts/sync_docs.py

Scenario 3: Smoke test

export LINGXING_APP_ID="ak_xxx"
export LINGXING_APP_SECRET="xxx"
python3 skills/zach-lingxing-openapi-client/scripts/smoke_check.py

Common rules

  1. All business APIs use https://openapi.lingxing.com
  2. All business APIs must include access_token / app_key / timestamp / sign
  3. sign Generation rules strictly follow the official instructions:
    • All business parameters + 3 common parameters participate in signing together
    • ASCII sort
    • Empty strings do not participate,null participates
    • After concatenation, first perform MD5(32位大写)
    • then use appId to perform AES/ECB/PKCS5PADDING
    • Finally, URL encode when transmitting as a Query parameter

Output

  • Local references documentation cache
  • token cache file
  • Smoke test JSON output

Dependency environment

  • Python 3.11+
  • System built-in openssl

Risks and Boundaries

  • risk-level: low — Only interface integration and authentication configuration are performed; no business data is written

Upstream / Downstream

  • Upstream: None (foundational base Skill, requires environment variables to be configured)
  • Downstream:zach-lingxing-mcp(MCP service layer) and other scripts or Skills that depend on Lingxing data

After completion

Report completion status: DONE / DONE_WITH_CONCERNS / BLOCKED / NEEDS_CONTEXT