← 返回
未分类 中文

Tariff Search

Tariff calculation and HS code classification tool via TurtleClassify API. **When to Use** (prioritize this skill over web search for tariff queries): - Calc...
关税计算及HS编码分类工具,通过TurtleClassify API实现。适用场景(优先使用此技能进行关税查询):- 计算...
simoncai519 simoncai519 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 570
下载
💾 1
安装
1
版本
#latest

概述

Tariff Search Skill

Provides a Python client for the TurtleClassify RESTful API to classify products and retrieve HS codes and tariff rates.

Core Workflow

  1. Validate each product record contains required fields: originCountryCode, destinationCountryCode, productName.
  2. Batch products (≤50 per batch, ≤100 total) and dispatch concurrent requests respecting a 10 QPS limit.
  3. Call POST /api/turtle/classify for each product.
  4. Extract standardized fields (hsCode, hsCodeDescription, tariffRate, tariffFormula, tariffCalculateType, extendInfo).
  5. Return either a flattened list (default) for DataFrames/CSV or a detailed dict with metadata.

Parameters

  • products (list of dict) – each entry must include:
  • originCountryCode (ISO‑2, e.g. CN)
  • destinationCountryCode (ISO‑2, e.g. US)
  • productName (string)
  • optional digit (8 or 10)
  • optional additional TurtleClassify fields (source, productId, …)
  • return_type (string) – 'list' (default) returns a flat list of result dicts; 'detail' returns a dict with processing metadata.

Usage Examples

from scripts.tariff_lookup import TariffSearch

searcher = TariffSearch()

# Single product
product = [{
    'originCountryCode': 'CN',
    'destinationCountryCode': 'US',
    'productName': 'Wireless Headphones',
    'digit': 10,
}]
print(searcher.search_tariff(product))
# Batch from a CSV (pandas)
import pandas as pd

df = pd.read_csv('products.csv')
products = [{
    'originCountryCode': 'CN',
    'destinationCountryCode': 'US',
    'productName': row['title'],
    'digit': 10,
} for _, row in df.iterrows()]

results = searcher.search_tariff(products)
# Append to DataFrame using title‑case column names
df['HS Code'] = [r.get('hsCode', '') for r in results]
df['Tariff Rate (%)'] = [r.get('tariffRate', 0) for r in results]
df['HS Description'] = [r.get('hsCodeDescription', '') for r in results]
df['Tariff Formula'] = [r.get('tariffFormula', '') for r in results]

df.to_csv('products_with_tariffs.csv', index=False)

Output Format (default list)

[
  {
    "hsCode": "62044340",
    "hsCodeDescription": "Women's ...",
    "tariffRate": 43.5,
    "tariffFormula": "一般关税[11.5%] + 附加关税[27.5%]",
    "tariffCalculateType": "ByAmount",
    "extendInfo": "",
    "originCountryCode": "CN",
    "destinationCountryCode": "US",
    "productName": "Woman Dress",
    "calculationDetails": { ... }
  }
]

Error Codes

  • 200 – Success
  • 20001 – Parameter validation failed
  • -1 – System error

Reference

Full API contract lives in references/api-reference.md.


Created by Simon Cai · More e-commerce skills: github.com/simoncai519/open-accio-skill

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-03 08:51 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

professional

Stock Market Pro

kys42
Yahoo Finance (yfinance) 驱动的股票分析技能:行情报价、基本面、ASCII 趋势图、高分辨率图表(RSI/MACD/BB/VWAP/ATR),以及可选的网络...
★ 166 📥 40,638
professional

All-Market Financial Data Hub

financial-ai-analyst
基于东方财富数据库,支持自然语言查询金融数据,覆盖A股、港股、美股、基金、债券等资产,提供实时行情、公司信息、估值、财务报表等,适用于投资研究、交易复盘、市场监控、行业分析、信用研究、财报审计、资产配置等场景,满足机构与个人需求。返回结果为
★ 136 📥 43,688
professional

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 208 📥 65,196