Code Monkey home page Code Monkey logo

Comments (1)

albertandking avatar albertandking commented on June 4, 2024

price=stock_zh_a_hist(symbol="512760", period="daily", start_date="20230327", end_date="20230329", adjust="")这句调用会报异常: File "c:\Users\JX\AppData\Local\Programs\Python\Python312\Lib\site-packages\akshare\stock_feature\stock_hist_em.py", line 1051, in stock_zh_a_hist "secid": f"{code_id_dict[symbol]}.{symbol}", ~~~~~~~~~~~~^^^^^^^^ KeyError: '512760'

东财原始API是支持这样调用的: https://push2his.eastmoney.com/api/qt/stock/kline/get?secid=1.512760&ut=fa5fd1943c7b386f172d6893dbfba10b&fields1=f1%2Cf2%2Cf3%2Cf4%2Cf5%2Cf6&fields2=f51%2Cf52%2Cf53%2Cf54%2Cf55%2Cf56%2Cf57%2Cf58%2Cf59%2Cf60%2Cf61&klt=101&fqt=1&end=20240504&lmt=210&cb=quote_jp1

问题出在code_id_dict = code_id_map_em()里面并没有包括512760,导致"secid": f"{code_id_dict[symbol]}.{symbol}"这句代码异常。

接口正常,按文档说明使用

from akshare.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.