{"id":21090673,"url":"https://github.com/ycrao/some-spider-code","last_synced_at":"2025-06-29T13:33:40.472Z","repository":{"id":199865581,"uuid":"703901117","full_name":"ycrao/some-spider-code","owner":"ycrao","description":"some spider code 财经资讯以及基金股票外汇价格爬虫","archived":false,"fork":false,"pushed_at":"2025-05-15T03:35:58.000Z","size":978,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-15T04:27:40.794Z","etag":null,"topics":["ai","crawler","deep-seek","economics","fin-eco-news","finance","forex","fund-value","spider","stock-price"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ycrao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-10-12T06:31:21.000Z","updated_at":"2025-05-15T03:36:01.000Z","dependencies_parsed_at":"2025-05-15T04:36:06.886Z","dependency_job_id":null,"html_url":"https://github.com/ycrao/some-spider-code","commit_stats":{"total_commits":15,"total_committers":2,"mean_commits":7.5,"dds":0.06666666666666665,"last_synced_commit":"f91158401379b2e9ac04befccea03a1da2578cd6"},"previous_names":["ycrao/some-spider-code"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycrao%2Fsome-spider-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycrao%2Fsome-spider-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycrao%2Fsome-spider-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycrao%2Fsome-spider-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ycrao","download_url":"https://codeload.github.com/ycrao/some-spider-code/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254538418,"owners_count":22087862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","crawler","deep-seek","economics","fin-eco-news","finance","forex","fund-value","spider","stock-price"],"created_at":"2024-11-19T21:39:12.570Z","updated_at":"2025-05-16T13:31:37.872Z","avatar_url":"https://github.com/ycrao.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"some-spider-code\n----------------\n\n### usage\n\n```bash\n# runtime: python \u003e= 3.8\npython -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\n# then run code\npython fin-eco-news-spider-by-sina.py\n# ...\n```\n\n### fin-eco-news-spider-by-sina\n\n\u003e   [fin-eco-news-spider-by-sina.py](./fin-eco-news-spider-by-sina.py)：新浪全球实时财经新闻爬虫。\n\n![sina-spider](./assets/sina.png)\n\n### fin-eco-news-spider-by-eastmoney\n\n\u003e   [fin-eco-news-spider-by-eastmoney.py](./fin-eco-news-spider-by-eastmoney.py)：东方财富全球财经快讯爬虫。\n\n![eastmoney-spider](./assets/eastmoney.png)\n\n### fin-eco-news-spider-by-jrwei\n\n\u003e   [fin-eco-news-spider-by-jrwei.py](./fin-eco-news-spider-by-jrwei.py)：金融圈财经快讯爬虫。\n\n![jrwei-spider](./assets/jrwei.png)\n\n### fund-value\n\n\u003e   [fund-value.py](./fund-value.py)：基金净值爬虫。\n\n```bash\n# 9501 as port\npython fund-value.py 9501\n```\n\nOpen `http://127.0.0.1:9501/012414` in browser. You can change `012414` (fund code) to another. See all codes in [data/fund.csv](./data/fund.csv) file.\n\nResponse example:\n\n```json\n{\n    \"code\": 200,\n    \"message\": \"ok\",\n    \"data\": {\n        \"fund_code\": \"002939\",\n        \"fund_name\": \"广发创新升级混合\",\n        \"net_value\": \"1.9049\",\n        \"net_value_date\": \"2023-11-15\",\n        \"estimated_net_value\": \"1.8643\",\n        \"estimated_growth_value\": \"-0.0406\",\n        \"estimated_growth_rate\": \"-2.13%\",\n        \"estimated_at\": \"2023-11-16 15:00:00\"\n    }\n}\n```\n\n### stock-price\n\n\u003e   [stock-price.py](./stock-price.py)：股票行情爬虫。\n\nSymbol rule: `sh600519` （沪市） or `sz300750` （深市） .\n\n```bash\n# 9502 as port\npython stock-price.py 9502\n```\n\nOpen `http://127.0.0.1:9502/sz300750?source=sina` in browser. You can change `sz300750` (Chinese stock code) to another, and the value of source `sina` (新浪) to `tencent` (腾讯) or `xueqiu` (雪球) . \n\nResponse example:\n\n```json\n{\n    \"code\": 200,\n    \"message\": \"ok\",\n    \"data\": {\n        \"source\": \"sina\",\n        \"name\": \"宁德时代\",\n        \"open\": 179.85,\n        \"close\": 181.15,\n        \"current\": 180.91,\n        \"high\": 181.25,\n        \"low\": 179.49,\n        \"buy\": 180.89,\n        \"sell\": 180.9,\n        \"volume\": 56526,\n        \"amount\": 101923,\n        \"buy1_volume\": 14,\n        \"buy1\": 180.89,\n        \"buy2_volume\": 5,\n        \"buy2\": 180.83,\n        \"buy3_volume\": 1,\n        \"buy3\": 180.82,\n        \"buy4_volume\": 2,\n        \"buy4\": 180.8,\n        \"buy5_volume\": 2,\n        \"buy5\": 180.78,\n        \"sell1_volume\": 6,\n        \"sell1\": 180.9,\n        \"sell2_volume\": 6,\n        \"sell2\": 180.91,\n        \"sell3_volume\": 5,\n        \"sell3\": 180.92,\n        \"sell4_volume\": 5,\n        \"sell4\": 180.94,\n        \"sell5_volume\": 1,\n        \"sell5\": 180.95,\n        \"date_time\": \"2023-11-17 10:57:12\"\n    }\n}\n```\n\n\u003e   *Notice*: `data.volume`,`data.buyX_volume` and `data.sellY_volume` are the number of hands （`手`, 1手=100股）; `data.amount` is the amount of money but in ten thousand yuan unit（`万元`）; others are in yuan unit（`元`）.\n\n\n### trans-price\n\n\u003e   [trans-price.py](./trans-price.py)：内外盘金银价格互转。当前上海金银 `Au(T+D)/Ag(T+D)` 相对于国际金银 `XAU/XAG` 均溢价不少，这个工具可以很方便快捷地进行转换。\n\n| 时间                 | 国内金银                                     | 国际金银                                    | 汇率       | 溢价                             |\n|--------------------|------------------------------------------|-----------------------------------------|----------|--------------------------------|\n| `2024-05-30 21:00` | `Au(T+D) 552.39 cny/g =\u003e 2367.84 usd/oz` | `XAUUSD 2341.22 usd/oz =\u003e 546.18 cny/g` | `7.2561` | `6.21 cny/g` or `25.78 usd/oz` |\n| `2024-05-30 21:15` | `Ag(T+D) 8267 cny/kg =\u003e 35.450 usd/oz`   | `XAGUSD 31.467 usd/oz =\u003e 7338 cny/kg`   | `7.2534` | `929 cny/kg` or `3.983 usd/oz` |\n\n\u003e   从上表可看到，国内白银相对于国际白银人民币计价溢超 900元每公斤，美元计价溢近 4美元每盎司。一些公开资料说中国央行最近2，3年一直在买入贵金属，且白银具有工业用途，国内新能源车、光伏等行业有大量需求，再加上各种税，这些举措一起进一步推高国内外金银价差。\n\n\u003e   Translate China silver price (in cny/kg unit) to USA `XAGUSD` price  (in usd/oz unit). Translate China gold price (in cny/g unit) to USA `XAUUSD` price (in usd/oz unit).\n\n```bash\n# 9503 as port\npython trans-price.py 9503\n```\n\nOpen these api urls to see response.\n\n```\nhttp://127.0.0.1:9503/trans-price/autd?price=551.64\nhttp://127.0.0.1:9503/trans-price/agtd?price=8508\u0026fx_rate=7.2648\nhttp://127.0.0.1:9503/trans-price/xau?price=2332.68\u0026fx_rate=7.2530\nhttp://127.0.0.1:9503/trans-price/xag?price=31.390\n```\n\nResponse example:\n\nGold price: `Au(T+D) 551.64 cny/g` ≈ `XAUUSD 2364.46 usd/oz` by forex rate `7.2566`.\n\n```json\n{\n    \"code\": 200,\n    \"message\": \"ok\",\n    \"data\": {\n        \"symbol\": \"autd\",\n        \"original_price\": 551.64,\n        \"original_unit\": \"cny/g\",\n        \"fx_rate\": 7.2566,\n        \"fx_from\": \"招商银行(CMB)\",\n        \"fx_detail\": {\n            \"source\": \"cmb\",\n            \"name\": \"1美元兑人民币\",\n            \"symbol\": \"usd2cny\",\n            \"middle_price\": null,\n            \"price\": 7.2566,\n            \"datetime\": \"2024-05-30 18:01:14\"\n        },\n        \"target_price\": 2364.46,\n        \"target_unit\": \"usd/oz\"\n    }\n}\n```\n\nSilver price: `Ag(T+D) 8508 cny/kg` ≈ `XAGUSD 36.426 usd/oz` by forex rate `7.2648`.\n\n```json\n{\n    \"code\": 200,\n    \"message\": \"ok\",\n    \"data\": {\n        \"symbol\": \"agtd\",\n        \"original_price\": 8508,\n        \"original_unit\": \"cny/kg\",\n        \"fx_rate\": 7.2648,\n        \"fx_from\": \"用户输入(UserInput)\",\n        \"fx_detail\": null,\n        \"target_price\": 36.426,\n        \"target_unit\": \"usd/oz\"\n    }\n}\n```\n\n### deep-seek\n\n\u003e   [ask-deep-seek-ai.py](./ask-deep-seek-ai.py)：通过 `api` 接口方式调用 `deep-seek` 。DeepSeek 官方最近遭受攻击，API 请求可能存在缓慢无响应等异常。建议使用硅基流动托管的 DeepSeek 服务，走下面链接注册，本人能收到硅基流动赠金 https://cloud.siliconflow.cn/i/c43wkWpu 。感谢支持！\n\n```bash\nsource venv/bin/activate\n# update deps\npip install -r requirements.txt\n# generate a new env config from example file\ncp -r .env.example .env\n# setting api-keys\nvim .env\n# change question then run code\nvim ask-deep-seek-ai.py\npython ask-deep-seek-ai.py\n# ollama 版本 \n# (前置条件已安装 ollama 软件，并下载安装好适合自身电脑的 deepseek-r1 模型）\n# 16G 内存配置电脑推荐安装 7B 版本即可，下载链接 https://ollama.com/library/deepseek-r1:7b\npython ask-deep-seek-ai-by-ollama.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fycrao%2Fsome-spider-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fycrao%2Fsome-spider-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fycrao%2Fsome-spider-code/lists"}