{"owner":"akfamily","repo":"akshare","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["llms.txt"],"files":{"llms.txt":"# AKShare\n\nAKShare is an open-source Python financial data interface library.\n\nIt provides public financial market data and alternative data from many sources,\nespecially for China markets, including A-share, Hong Kong stocks, U.S.\nstocks, funds, futures, options, bonds, forex, macroeconomic indicators,\nindustry data, news, and cryptocurrency data.\n\nAKShare is designed around a simple idea: write less, get more. Most public\ninterfaces return `pandas.DataFrame` objects and are meant to be called from the\ntop-level package.\n\n## Install\n\nUse pip:\n\n`pip install akshare --upgrade`\n\n## Python Entry Point\n\nImport AKShare as:\n\n```python\nimport akshare as ak\n```\n\nAll public interfaces are exposed from the top-level package and are typically\ncalled as:\n\n```python\nak.function_name(...)\n```\n\nDo not assume users need to import submodules directly unless you are working on\nAKShare internals.\n\n## Documentation\n\nMain entry points:\n\n- `README.md`\n- `docs/tutorial.md`\n- `docs/data/`\n- Online docs: `https://akshare.akfamily.xyz/`\n- Data interface index: `https://akshare.akfamily.xyz/data/index.html`\n\nThe most important interface documentation is organized by category under\n`docs/data/`.\n\n## Interface Registry (Offline Search)\n\nAKShare ships a small, bundled interface registry to help locate function\nnames without manually grepping through `docs/data/`:\n\n- `ak.search(query)`: keyword search across interface names, descriptions,\n  categories, and output columns. Returns a ranked `pandas.DataFrame`.\n- `ak.interface_info(name)`: full metadata for one interface, including\n  input parameters, output columns, and an example snippet.\n- `ak.list_categories()`: lists all categories with interface counts.\n\nThis registry is entirely offline: its data ships inside the package and\nno network request is made, so it is safe to call before deciding whether\na network call is worth making.\n\nIt is a keyword/substring matcher, not a semantic search engine. It is\nbest at pinpointing an interface by exact or near-exact name and at\nnarrowing candidates by keyword — it does not reliably understand natural\nlanguage intent.\n\n```python\nimport akshare as ak\n\nak.search(\"A股 历史行情\")\nak.interface_info(\"stock_zh_a_hist\")\n```\n\n## Core Usage Pattern\n\nRecommended workflow:\n\n1. Identify the asset class or topic.\n2. Find the matching documentation page under `docs/data/`.\n3. Use the documented public function from `akshare`.\n4. Inspect the returned `DataFrame` columns before downstream processing.\n\n## Major Categories\n\nCommon data categories include:\n\n- `stock`: stock market data, including A-share, Hong Kong stocks, U.S.\n  stocks, spot data, historical data, and stock information\n- `stock_feature`: rankings, capital flow, margin trading, technical data, and\n  market feature datasets\n- `stock_fundamental`: company fundamentals, financial statements, equity\n  structure, and disclosures\n- `fund`: public fund data, ETFs, rankings, holdings, managers, and net value\n- `futures`: domestic and global futures market data\n- `option`: option market data\n- `bond`: bond and convertible bond data\n- `index`: market index data\n- `forex` and `fx`: foreign exchange data\n- `macro` and `economic`: macroeconomic and statistical data\n- `news`: financial news and information\n- `crypto`: cryptocurrency market data\n- `tool`: trading calendar and utility datasets\n\n## Naming Conventions\n\nAKShare function names usually encode both the topic and the data source.\n\nCommon suffixes include:\n\n- `_em`: EastMoney\n- `_sina`: Sina\n- `_ths`: Tonghuashun\n- `_cninfo`: CNINFO\n- `_xq`: Xueqiu\n\nChoose functions based on documented behavior, not only by suffix similarity.\n\n## Return Types And Parameters\n\nCommon conventions:\n\n- Most public interfaces return `pandas.DataFrame`.\n- Date parameters are often strings such as `YYYYMMDD`.\n- Symbol parameters may use market-specific codes.\n- Returned column names are often Chinese because they follow upstream data\n  semantics or established AKShare conventions.\n\n## Important Notes For LLMs And Agents\n\nWhen helping users with AKShare:\n\n- Prefer documented public functions over internal helpers.\n- Prefer top-level calls such as `ak.stock_zh_a_hist(...)` instead of submodule\n  imports.\n- Check `docs/data/` before guessing interface names.\n- Many interfaces depend on upstream public websites and may break when\n  upstream providers change.\n- Data freshness can vary by source; if results look stale, verify whether the\n  upstream source still provides updated data.\n- Inspect returned columns before making assumptions about field names, units,\n  or semantics.\n\n## Example Function Families\n\nRepresentative examples:\n\n- `ak.stock_zh_a_spot_em()`\n- `ak.stock_zh_a_hist(...)`\n- `ak.stock_individual_info_em(...)`\n- `ak.fund_open_fund_info_em(...)`\n- `ak.futures_zh_spot()`\n- `ak.option_current_em()`\n- `ak.bond_zh_hs_cov_spot()`\n- `ak.macro_china_cpi()`\n- `ak.news_cctv()`\n- `ak.crypto_hist(...)`\n\n## Project Structure\n\nAKShare is organized by domain subpackages under `akshare/`, but user-facing\ncalls are flat through the top-level package.\n\nImportant structure:\n\n- Source code: `akshare/`\n- Public API export hub: `akshare/__init__.py`\n- Main documentation: `docs/`\n- Data interface docs: `docs/data/`\n\n## If Editing AKShare Source\n\nWhen adding or fixing a public interface:\n\n- Keep the external API stable whenever possible.\n- Add the public import to `akshare/__init__.py`, or users cannot call it as\n  `ak.function_name(...)`.\n- Update the corresponding documentation under `docs/data/`.\n- Update `docs/changelog.md` for user-visible fixes or new interfaces.\n\n## Preferred Guidance Style\n\nIf you are an LLM or coding agent helping a user:\n\n1. Clarify the market, asset class, and target dataset.\n2. Identify the most likely documented interface.\n3. Provide a minimal working AKShare example.\n4. Explain likely parameter formats.\n5. Mention upstream availability or freshness limits when relevant.\n"}}