{"record":{"id":"0cbc4607887de26f","repo":"jackwener/OpenCLI","slug":"no-data-0cbc46","errorCode":"NO_DATA","errorMessage":"eastmoney returned no quotes","messagePattern":"eastmoney returned no quotes","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"warning","filePath":"clis/eastmoney/quote.js","lineNumber":85,"sourceCode":"    /** @type {string[]} */\n    const secids = [];\n    for (const s of raw) {\n      try { secids.push(resolveSecid(s)); }\n      catch (err) { throw new CliError('INVALID_ARGUMENT', `Unrecognized symbol \"${s}\"`); }\n    }\n\n    // Multi-stock in one call via ulist.np\n    const url = new URL('https://push2.eastmoney.com/api/qt/ulist.np/get');\n    url.searchParams.set('secids', secids.join(','));\n    url.searchParams.set('fltt', '2');\n    url.searchParams.set('fields', FIELDS);\n    url.searchParams.set('ut', 'bd1d9ddb04089700cf9c27f6f7426281');\n\n    const resp = await fetch(url, { headers: { 'User-Agent': 'Mozilla/5.0', Accept: 'application/json' } });\n    if (!resp.ok) throw new CliError('HTTP_ERROR', `eastmoney quote failed: HTTP ${resp.status}`);\n    const data = await resp.json();\n    const diff = Array.isArray(data?.data?.diff) ? data.data.diff : [];\n    if (diff.length === 0) throw new CliError('NO_DATA', 'eastmoney returned no quotes', `Check symbols: ${raw.join(', ')}`);\n\n    return diff.map((it) => ({\n      code: it.f12,\n      name: it.f14,\n      market: marketLabel(it.f13),\n      price: it.f2,\n      changePercent: it.f3,\n      change: it.f4,\n      open: it.f17,\n      high: it.f15,\n      low: it.f16,\n      prevClose: it.f18,\n      volume: it.f5,\n      turnover: it.f6,\n      turnoverRate: it.f8,\n      amplitude: it.f7,\n      peDynamic: it.f9,\n      priceBook: it.f23,","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/eastmoney/quote.js#L67-L103","documentation":"The quote request returned HTTP 200, but data.data.diff is missing or empty, so quote.js throws CliError NO_DATA ('eastmoney returned no quotes') with a hint listing the symbols requested. This means eastmoney answered but matched none of the provided secids.","triggerScenarios":"All supplied symbols resolved to secids that eastmoney does not recognize — e.g. delisted codes, wrong-market assignments (a SH code guessed as SZ), suspended symbols with no quote, or typo'd codes that still passed resolveSecid's pattern checks; also eastmoney returning empty diff during API degradation.","commonSituations":"Querying delisted or long-suspended tickers; typo'd 6-digit codes that are syntactically valid but nonexistent; requesting US/HK symbols while the specific market feed hiccups; stale symbol lists in automated dashboards after corporate actions (mergers, delistings).","solutions":["Check each symbol: verify codes exist and are currently listed (the error hint lists the exact symbols sent)","Add a market prefix to disambiguate, e.g. 'sh600000' instead of bare '600000'","Test one symbol at a time to isolate the bad one — one bad secid can empty the whole ulist response","Retry later if eastmoney is having a partial outage; curl the URL to inspect the raw diff","Refresh symbol lists to drop delisted/renamed codes"],"exampleFix":"// before\nquote --symbols=\"600000,999999\"   // 999999 doesn't exist\n// after\nquote --symbols=\"600000\"          // drop invalid codes; test suspects individually","handlingStrategy":"validation","validationCode":"const KNOWN = new Set(['600000','000001','00700.HK','AAPL']); // your maintained universe\nconst unknown = requested.filter((s) => !KNOWN.has(s.toUpperCase()) && !KNOWN.has(s));\nif (unknown.length) console.warn(`Symbols not in verified universe, may return no quotes: ${unknown.join(', ')}`);","typeGuard":"const looksListed = (s) => /^(?:(?:sh|sz|bj)\\d{6}|hk\\d{4,5}|\\d{6}|us\\.[a-z.\\-]+|[A-Z.\\-]{1,8})$/i.test(String(s).trim());","tryCatchPattern":"try {\n  await runQuote(args);\n} catch (e) {\n  if (e.code === 'NO_DATA') {\n    console.error(`No quotes for: ${e.hint ?? args.symbols}. Verify each code is listed and not delisted/suspended; try one symbol at a time.`);\n  } else throw e;\n}","preventionTips":["Verify each symbol once against a known-listed universe before bulk queries","Use market prefixes (sh/sz/hk/us.) to avoid wrong-market secid guesses","Query suspects individually — one bad secid can empty the entire response","Prune delisted/renamed symbols from automated dashboards regularly","If everything looks valid, retry later — eastmoney occasionally returns empty diffs during outages"],"tags":["empty-data","upstream-api","symbol-parsing","eastmoney"],"backgroundTag":"upstream-empty-data","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}