{
  "domain": "www.sse.com.cn",
  "url": "https://www.sse.com.cn/assortment/fund/etf/list/",
  "title": "上交所 ETF 产品列表",
  "summary": "上交所全部上市 ETF 列表，含基金代码、简称、全称、管理人、基金经理、托管人、上市日期、跟踪指数。通过 commonSoaQuery.do 接口按 subClass 分类查询。不含费率数据。",
  "method": "GET",
  "endpoint": "https://query.sse.com.cn/commonSoaQuery.do",
  "headers": {
    "Referer": "https://www.sse.com.cn/"
  },
  "params": {
    "sqlId": {
      "value": "FUND_LIST",
      "description": "固定值"
    },
    "fundType": {
      "value": "00",
      "description": "基金类型，00=ETF"
    },
    "subClass": {
      "type": "string",
      "required": true,
      "description": "ETF 分类代码",
      "enum": {
        "01": "单市场ETF（股票ETF，含沪深300等宽基、有色金属/稀土等行业主题）",
        "02": "债券ETF",
        "03,08": "跨市场ETF（沪港深等，页面 tab 对应跨境ETF）",
        "04": "跨境ETF",
        "05": "货币ETF",
        "06": "黄金ETF（商品实物，8只）",
        "09,31": "科创板相关ETF"
      },
      "page_tab_mapping": {
        "股票ETF_tab": "subClass=01 (单市场ETF)",
        "债券ETF_tab": "subClass=02,32",
        "跨境ETF_tab": "subClass=03,08,04",
        "商品ETF_tab": "subClass=06"
      },
      "note": "页面 tab 分类与 API subClass 映射来自页面 JS 对象 etfList.typeOption"
    },
    "isPagination": {
      "value": "true"
    },
    "pageHelp.pageSize": {
      "value": "500",
      "description": "每页条数，最大500可一次拉全"
    },
    "pageHelp.pageNo": {
      "value": "1"
    },
    "jsonCallBack": {
      "value": "cb",
      "description": "JSONP 回调函数名"
    }
  },
  "returns": {
    "format": "JSONP",
    "data_path": "pageHelp.data",
    "fields": {
      "fundCode": "基金代码，如 518880",
      "fundAbbr": "基金简称，如 黄金ETF",
      "secNameFull": "基金全称，如 黄金ETF华安",
      "companyName": "基金管理人，如 华安基金管理有限公司",
      "fundManager": "基金经理，如 许之彦",
      "TRUSTEE_NAME": "托管人，如 中国建设银行股份有限公司",
      "listingDate": "上市日期，格式 YYYYMMDD",
      "INDEX_NAME": "跟踪指数名称（商品ETF此字段为空）",
      "INDEX_CODE": "跟踪指数代码",
      "fundType": "基金类型代码",
      "subClass": "分类代码"
    },
    "total_field": "pageHelp.total"
  },
  "examples": {
    "all_stock_etf": "https://query.sse.com.cn/commonSoaQuery.do?jsonCallBack=cb&isPagination=true&pageHelp.pageSize=500&pageHelp.pageNo=1&sqlId=FUND_LIST&fundType=00&subClass=01",
    "commodity_etf": "https://query.sse.com.cn/commonSoaQuery.do?jsonCallBack=cb&isPagination=true&pageHelp.pageSize=500&pageHelp.pageNo=1&sqlId=FUND_LIST&fundType=00&subClass=06",
    "single_fund": "https://query.sse.com.cn/commonSoaQuery.do?jsonCallBack=cb&isPagination=false&sqlId=FUND_LIST&fundType=00&fundCode=518880"
  },
  "caveats": [
    "必须带 Referer: https://www.sse.com.cn/ 否则被拒",
    "返回 JSONP 格式，需用正则去掉 cb(...) 包装后解析 JSON",
    "不含费率（管理费/托管费）数据，需从 fundf10.eastmoney.com 补充",
    "商品ETF（subClass=06）的 INDEX_NAME 和 INDEX_CODE 为空",
    "subClass=04/07/10/11/12 当前无数据",
    "有色金属/稀土等 ETF 分散在 subClass=01（股票ETF）和 subClass=03（跨境ETF）中，需按名称关键词筛选"
  ],
  "data_coverage": {
    "as_of": "2026-04-22",
    "total_etfs": 696,
    "by_subclass": {
      "01_stock": 453,
      "02_bond": 22,
      "03_cross_border": 30,
      "05_money_market": 24,
      "06_commodity": 8,
      "08_shenzhen_hk": 30,
      "09_star_market": 108
    },
    "metal_related_count": 22,
    "metal_keywords": ["黄金", "金ETF", "上海金", "有色金属", "稀有金属", "稀土", "钢铁", "矿业", "工业有色"]
  },
  "action_steps_template": {
    "description": "点击分类 tab 切换 ETF 类别。页面有4个 tab：股票ETF、债券ETF、跨境ETF、商品ETF。将 {{category}} 替换为目标分类名，{{nth}} 替换为 tab 序号（1-4）。",
    "params": {
      "category": {
        "description": "分类名称",
        "enum": {
          "股票ETF": "nth=1（默认选中）",
          "债券ETF": "nth=2",
          "跨境ETF": "nth=3",
          "商品ETF": "nth=4"
        }
      }
    },
    "steps": [
      {
        "type": "click",
        "selector": ".js_navTabs span:nth-child({{nth}})",
        "wait": 2000
      }
    ],
    "verify": {
      "selector": ".js_navTabs span.active",
      "text": "{{category}}"
    },
    "examples": {
      "commodity_etf": {
        "description": "切换到商品ETF tab，显示8只商品ETF（含黄金ETF等）",
        "steps": [
          {"type": "click", "selector": ".js_navTabs span:nth-child(4)", "wait": 2000}
        ],
        "verify": {"selector": ".js_navTabs span.active", "text": "商品ETF"}
      },
      "bond_etf": {
        "description": "切换到债券ETF tab",
        "steps": [
          {"type": "click", "selector": ".js_navTabs span:nth-child(2)", "wait": 2000}
        ],
        "verify": {"selector": ".js_navTabs span.active", "text": "债券ETF"}
      }
    },
    "keyword_filter": {
      "description": "按关键词筛选 ETF。页面本身无搜索框，此模板通过注入 JSONP 请求拉取全量数据（跨所有 subClass），然后替换表格内容为匹配行。将 {{keyword}} 替换为搜索词。",
      "how_it_works": "通过 <script> 标签发起 JSONP 请求（绕过 CORS），遍历 subClass 01/03/08/09 拉取全部 ETF，按 fundAbbr + secNameFull + INDEX_NAME 做 indexOf 匹配，替换 tbody 内容并隐藏分页器。",
      "steps": [
        {
          "type": "exec_js",
          "code": "(function(){window.__allItems=[];window.__kw='{{keyword}}';window.__done=false;var scs=['01','03','08','09'];var loaded=0;scs.forEach(function(sc){var cb='__cb_'+sc;window[cb]=function(d){var items=d.pageHelp?d.pageHelp.data:[];window.__allItems=window.__allItems.concat(items);loaded++;if(loaded>=scs.length){var matched=window.__allItems.filter(function(i){return((i.fundAbbr||'')+(i.secNameFull||'')+(i.INDEX_NAME||'')).indexOf(window.__kw)>=0});var tbody=document.querySelector('.js_etfList table tbody');var html='';matched.forEach(function(i){html+='<tr><td><a href=\"/assortment/fund/list/etfinfo/basic/index.shtml?FUNDID='+i.fundCode+'\">'+i.fundCode+'</a></td><td>'+i.secNameFull+'</td><td>'+i.companyName+'</td><td>'+i.INDEX_NAME+'</td></tr>'});tbody.innerHTML=html;var p=document.querySelector('.js_etfList .common_page');if(p)p.style.display='none';document.querySelectorAll('.js_navTabs span').forEach(function(s){s.classList.remove('active')});window.__filterResult='found='+matched.length+'/'+window.__allItems.length;window.__done=true}};var s=document.createElement('script');s.src='//query.sse.com.cn/commonSoaQuery.do?jsonCallBack='+cb+'&isPagination=true&pageHelp.pageSize=500&pageHelp.pageNo=1&sqlId=FUND_LIST&fundType=00&subClass='+sc;document.head.appendChild(s)});return 'loading...'})()",
          "wait": 8000
        },
        {
          "type": "exec_js",
          "code": "window.__filterResult||('done='+window.__done+' items='+window.__allItems.length)",
          "wait": 500
        }
      ],
      "examples": {
        "nonferrous_metals": {
          "description": "筛选名称或跟踪指数含「有色」的 ETF",
          "keyword": "有色",
          "expected_result": "found=6/642"
        },
        "gold": {
          "description": "筛选黄金相关 ETF",
          "keyword": "黄金",
          "expected_result": "found=10+/642"
        },
        "rare_earth": {
          "description": "筛选稀土相关 ETF",
          "keyword": "稀土",
          "expected_result": "found=2/642"
        }
      },
      "verified": "2026-04-22, tested with keyword=有色, result: found=6/642 ✅"
    }
  },
  "confidence": 0.95,
  "last_verified": "2026-04-22"
}
