{"id":21743790,"url":"https://github.com/h2y/apis","last_synced_at":"2025-08-17T19:33:58.410Z","repository":{"id":75782917,"uuid":"68186377","full_name":"h2y/apis","owner":"h2y","description":"使用 Node 编写的一系列 REST API。","archived":false,"fork":false,"pushed_at":"2017-03-27T15:55:04.000Z","size":44,"stargazers_count":23,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T05:07:14.414Z","etag":null,"topics":["api","node","server"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/h2y.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":"2016-09-14T08:02:36.000Z","updated_at":"2022-11-10T08:53:48.000Z","dependencies_parsed_at":"2023-03-04T23:15:26.191Z","dependency_job_id":null,"html_url":"https://github.com/h2y/apis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/h2y/apis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h2y%2Fapis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h2y%2Fapis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h2y%2Fapis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h2y%2Fapis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h2y","download_url":"https://codeload.github.com/h2y/apis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h2y%2Fapis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270898712,"owners_count":24664704,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","node","server"],"created_at":"2024-11-26T07:09:07.443Z","updated_at":"2025-08-17T19:33:58.402Z","avatar_url":"https://github.com/h2y.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# APIs by h2y\n\n这个仓库是一个单独的 Node 应用，基于 [restify](http://restify.com/) 开发，运行后可提供多个 API 的服务。每个文件夹实现一个 API 功能。\n\n该项目已运行于我的服务器 \u003chttps://api.hzy.pw/\u003e 中，大家可以直接调用，无任何限制。不过我不保证稳定性，所以更推荐大家下载源码，将这组 API 运行在自己的服务器中。\n\n## /avatar\n\n**[] 随机 SVG 矢量图形 []**\n\n![](https://camo.githubusercontent.com/b42d9837352ca7e294639ff1cc95f1e6798d85c3/68747470733a2f2f6a64656e7469636f6e2e636f6d2f686f737465642f6769746875622d73616d706c65732e706e67)\n\n生成矢量风格的图片，传入两个参数：尺寸和 Hash 值，输出一个 SVG 图片，**并且保证对传入相同的 Hash 时返回的头像是相同的。**\n\n可以用在任何用户系统中，当用户没有上传头像时，可根据 userID 生成一个独一无二的头像，而不是所有人都显示一个默认头像。\n\n### 请求\n\n\u003e GET: \u003chttps://api.hzy.pw/avatar/v1/150/key\u003e\n\n返回 hash 值为 `key` 并且尺寸为 `150px*150px` 的矢量图形。\n\n\u003e GET: \u003chttps://api.hzy.pw/avatar/v1/70/\u003e\n\n返回尺寸为 `70px*70px` 的随机矢量图形。（每次请求的返回均不相同）\n\n### 前端显示\n\n返回类型为 SVG，所以不能使用 `\u003cimg\u003e`，请使用 `\u003cembed\u003e` 标签插入到前端页面中：\n\n`\u003cembed src=\"https://api.hzy.pw/avatar/v1/99/key\" width=\"99\" height=\"99\" type=\"image/svg+xml\" /\u003e`\n\n\n## /saying\n\n**[] 随机名人名言 []**\n\n每次访问返回一条随机的名人名言，提供 3 个 API 接口，分别返回来自 _一个、金山词霸_ 两个网站中采集的名言。其中词霸接口返回的名言是中英文对照的，很高大上。\n\n返回内容涵盖了能采集到的所有信息，包括名言的配图，所以也可以作为 **随机图片获取接口** 来使用。\n\n### 请求\n\n\u003e GET: \u003chttps://api.hzy.pw/saying/v1/one\u003e\n\n返回来自 _ONE·一个_ 的名言\n\n\u003e GET: \u003chttps://api.hzy.pw/saying/v1/ciba\u003e\n\n返回来自 _金山词霸每日一句_ 的名言\n\n### 示例\n\n\u003e GET: \u003chttps://api.hzy.pw/saying/v1/ciba\u003e\n\n```json\n{\n    \"cn\": \"你可以拥有一切，只是不能一次就全到手。(Oprah Winfrey)\",\n    \"cnFix\": \"你可以拥有一切，只是不能一次就全到手。\",\n    \"en\": \"You can have it all. You just can't have it all at once.\",\n    \"date\": \"2015-05-24\",\n    \"pic\": \"http://cdn.iciba.com/news/word/big_2015-05-24b.jpg\",\n    \"picSmall\": \"http://cdn.iciba.com/news/word/2015-05-24.jpg\",\n    \"picSquare\": \"http://cdn.iciba.com/news/word/xiaomi_2015-05-24mi.jpg\",\n    \"link\": \"http://www.iciba.com/dailysentence/1299\",\n    \"linkPC\": \"http://news.iciba.com/views/dailysentence/daily.html#!/detail/sid/1299\"\n}\n```\n\n**注意事项：**由于可采集到的内容不同，每个接口返回的内容结构并不完全一致。比如 one 接口不会返回 `en` 键。\n\n\n## /rss_maker\n\n**[] 任意网站 RSS 生成器 []**\n\n为任意网站生成 RSS 链接，支持 AJAX 网站。这并不是一个 REST API，与本项目毫无关系，但由于技术栈类似，我将其放在了这个本仓库的另一个分支当中。\n\n详情请点击：\u003chttps://github.com/h2y/apis/tree/rss-maker\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh2y%2Fapis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh2y%2Fapis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh2y%2Fapis/lists"}