{"id":19999230,"url":"https://github.com/mr-addict/api","last_synced_at":"2025-03-01T23:29:24.201Z","repository":{"id":65711477,"uuid":"597757897","full_name":"MR-Addict/api","owner":"MR-Addict","description":"Personal and public api center","archived":false,"fork":false,"pushed_at":"2023-04-04T13:29:19.000Z","size":30168,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-12T12:46:53.326Z","etag":null,"topics":["api","nodejs","puppeteer","serverless"],"latest_commit_sha":null,"homepage":"https://api.mraddict.one","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MR-Addict.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-02-05T14:57:40.000Z","updated_at":"2023-05-01T03:22:00.000Z","dependencies_parsed_at":"2024-11-13T05:11:16.294Z","dependency_job_id":"b0228bcb-0f23-4b9e-851e-0a7285c39a63","html_url":"https://github.com/MR-Addict/api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MR-Addict%2Fapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MR-Addict%2Fapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MR-Addict%2Fapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MR-Addict%2Fapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MR-Addict","download_url":"https://codeload.github.com/MR-Addict/api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241439486,"owners_count":19963095,"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":["api","nodejs","puppeteer","serverless"],"created_at":"2024-11-13T05:11:08.108Z","updated_at":"2025-03-01T23:29:24.181Z","avatar_url":"https://github.com/MR-Addict.png","language":"TypeScript","readme":"# API Center\n\n- [API Center](#api-center)\n  - [1. Screenshot API](#1-screenshot-api)\n    - [`/screenshot`](#screenshot)\n  - [2. Daily quotes API](#2-daily-quotes-api)\n    - [`/quote`](#quote)\n  - [3. Qndxx screenshot API](#3-qndxx-screenshot-api)\n    - [`/qndxx/current`](#qndxxcurrent)\n    - [`/qndxx/list`](#qndxxlist)\n  - [4. Lamp API](#4-lamp-api)\n    - [`/lamp`](#lamp)\n  - [5. OpenAI](#5-openai)\n    - [`/openai/chat`](#openaichat)\n\n## 1. Screenshot API\n\n### `/screenshot`\n\nTake any website screenshot from url\n\nMethod:\n\n| Key          | Value                             |\n| :----------- | :-------------------------------- |\n| Method       | POST                              |\n| Content-Type | application/x-www-form-urlencoded |\n| Response     | application/json                  |\n\nBody:\n\n| Body              | Value         | Default | Requirements |\n| :---------------- | :------------ | :------ | :----------- |\n| url               | string        | None    | required     |\n| type              | png,jpeg,webp | webp    | optional     |\n| width             | 320~3840      | 1920    | optional     |\n| height            | 240~2160      | 1080    | optional     |\n| delay             | 0~10          | 0       | optional     |\n| timeout           | 10~60         | 30      | optional     |\n| fullPage          | booelan       | false   | optional     |\n| disableAnimations | boolean       | false   | optional     |\n\nResponse:\n\n```json\n{\n  \"status\": true,\n  \"data\": {\n    \"type\": \"webp\",\n    \"runtime\": \"1.534s\",\n    \"url\": \"https://example.com\",\n    \"base64\": \"data:image/webp;base64,AFSDS4545aHR0cHM6Ly9leGFtcGxlLmNvbQ==\"\n  }\n}\n```\n\nExample:\n\n```bash\ncurl https://api.mraddict.one/screenshot -X POST -d 'url=https://example.com'\n```\n\n## 2. Daily quotes API\n\n### `/quote`\n\nGet daily quotes\n\nMethod:\n\n| Key      | Value            |\n| :------- | :--------------- |\n| Method   | GET              |\n| Response | application/json |\n\nSearch params:\n\n| Search params | Value  | Default | Requirements |\n| :------------ | :----- | :------ | :----------- |\n| date          | string | Today   | optional     |\n\nResponse:\n\n```json\n{\n  \"status\": true,\n  \"data\": {\n    \"date\": \"2023-02-20\",\n    \"zh\": \"你每生气一分钟，也就失去了六十秒的幸福。\",\n    \"en\": \"For every minute you are angry, you lose sixty seconds of happiness.\",\n    \"img\": \"https://staticedu-wps.cache.iciba.com/image/d486eb38c2ccb2a54de3d155a66eb31f.jpg\",\n    \"preview\": \"https://staticedu-wps.cache.iciba.com/image/d411ef78a741e412b9c8fe238b7faa5c.jpg\"\n  }\n}\n```\n\nExample:\n\n```bash\ncurl https://api.mraddict.one/quote?date=2023-02-20\n```\n\n## 3. Qndxx screenshot API\n\n### `/qndxx/current`\n\nGet **current** Qndxx data.\n\nMethod:\n\n| Key      | Value            |\n| :------- | :--------------- |\n| Method   | GET              |\n| Response | application/json |\n\nResponse:\n\n```json\n{\n  \"status\": true,\n  \"data\": {\n    \"id\": \"C0126\",\n    \"title\": \"2023年第3期\",\n    \"startTime\": \"2023-03-13 09:56:40\",\n    \"endTime\": \"2023-03-19 22:00:00\",\n    \"uri\": \"https://h5.cyol.com/special/daxuexi/fe3ao1cm3k/index.html\",\n    \"cover\": \"https://st-file.yunbanos.cn/uploadsoss/qczj-youth-learning/2023-03-13/bf51cb5ead3fcc30ee9557a86250398b.png\",\n    \"screenshot\": \"https://h5.cyol.com/special/daxuexi/fe3ao1cm3k/images/end.jpg\"\n  }\n}\n```\n\nExample:\n\n```bash\ncurl https://api.mraddict.one/qndxx/current\n```\n\n### `/qndxx/list`\n\nGet the latest **10** of Qndxx data.\n\nMethod:\n\n| Key      | Value            |\n| :------- | :--------------- |\n| Method   | GET              |\n| Response | application/json |\n\nResponse:\n\n```json\n{\n  \"status\": true,\n  \"data\": [\n    {\n    \"id\": \"C0126\",\n    \"title\": \"2023年第3期\",\n    \"startTime\": \"2023-03-13 09:56:40\",\n    \"endTime\": \"2023-03-19 22:00:00\",\n    \"uri\": \"https://h5.cyol.com/special/daxuexi/fe3ao1cm3k/index.html\",\n    \"cover\": \"https://st-file.yunbanos.cn/uploadsoss/qczj-youth-learning/2023-03-13/bf51cb5ead3fcc30ee9557a86250398b.png\",\n    \"screenshot\": \"https://h5.cyol.com/special/daxuexi/fe3ao1cm3k/images/end.jpg\"\n  },\n  ...\n  ]\n}\n```\n\nExample:\n\n```bash\ncurl https://api.mraddict.one/qndxx/list\n```\n\n## 4. Lamp API\n\n### `/lamp`\n\nControl my room desktop lamp:\n\nMethod:\n\n| Key          | Value                             |\n| :----------- | :-------------------------------- |\n| Method       | POST                              |\n| Content-Type | application/x-www-form-urlencoded |\n| Response     | No response                       |\n\nBody:\n\n| Body   | Value             | Default | Requirements |\n| :----- | :---------------- | :------ | :----------- |\n| token  | string            | None    | required     |\n| status | on,off            | None    | required     |\n| mode   | Bright,Night,Warm | Bright  | optional     |\n\nResponse:\n\nNo response.\n\nExample:\n\n```bash\n# turn lamp on\ncurl -X POST https://api.mraddict.one/lamp -d \"token=authorizedToken\u0026status=on\u0026mode=Bright\"\n# turn lamp off\ncurl -X POST https://api.mraddict.one/lamp -d \"token=authorizedToken\u0026status=off\"\n```\n\n## 5. OpenAI\n\n### `/openai/chat`\n\nCommunication with openAI:\n\nMethod:\n\n| Key          | Value            |\n| :----------- | :--------------- |\n| Method       | POST             |\n| Content-Type | application/json |\n| Response     | application/json |\n\nHeader:\n\n| Key           | Value        |\n| :------------ | :----------- |\n| authorization | openAIApiKey |\n\nBody:\n\n| Body              | Value   | Default | Requirements |\n| :---------------- | :------ | :------ | :----------- |\n| model             | string  | None    | required     |\n| messages          | array   | None    | required     |\n| temperature       | number  | None    | optional     |\n| top_p             | number  | None    | optional     |\n| n                 | number  | None    | optional     |\n| stream            | boolean | None    | optional     |\n| max_tokens        | number  | None    | optional     |\n| presence_penalty  | number  | None    | optional     |\n| frequency_penalty | number  | None    | optional     |\n\nResponse:\n\n```json\n{\n  \"status\": true,\n  \"data\": {\n    \"id\": \"chatcmpl-123\",\n    \"object\": \"chat.completion\",\n    \"created\": 1677652288,\n    \"choices\": [\n      {\n        \"index\": 0,\n        \"message\": {\n          \"role\": \"assistant\",\n          \"content\": \"\\n\\nHello there, how may I assist you today?\"\n        },\n        \"finish_reason\": \"stop\"\n      }\n    ],\n    \"usage\": {\n      \"prompt_tokens\": 9,\n      \"completion_tokens\": 12,\n      \"total_tokens\": 21\n    }\n  }\n}\n```\n\nExample:\n\n```js\nfetch(\"https://api.mraddict.one/openai/chat\", {\n  method: \"POST\",\n  headers: {\n    \"Content-Type\": \"application/json\",\n    Authorization: \"openAIApiKey\",\n  },\n  body: JSON.stringify({\n    model: \"gpt-3.5-turbo\",\n    messages: [\n      {\n        role: \"user\",\n        content: \"Tell me a joke\",\n      },\n    ],\n  }),\n})\n  .then((res) =\u003e res.json())\n  .then((res) =\u003e console.log(res));\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-addict%2Fapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmr-addict%2Fapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-addict%2Fapi/lists"}