{"id":33242418,"url":"https://github.com/axt-team/uapi-sdk-csharp","last_synced_at":"2026-04-15T10:03:33.660Z","repository":{"id":323478261,"uuid":"1093390870","full_name":"AxT-Team/uapi-sdk-csharp","owner":"AxT-Team","description":"UAPI 的 C#/.NET SDK","archived":false,"fork":false,"pushed_at":"2026-04-12T05:30:36.000Z","size":3322,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-12T07:18:04.166Z","etag":null,"topics":["api-client","csharp","dotnet","sdk","uapi"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/uapi-sdk-csharp","language":"C#","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/AxT-Team.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-10T10:01:56.000Z","updated_at":"2026-04-12T05:30:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/AxT-Team/uapi-sdk-csharp","commit_stats":null,"previous_names":["axt-team/uapi-sdk-csharp"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/AxT-Team/uapi-sdk-csharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxT-Team%2Fuapi-sdk-csharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxT-Team%2Fuapi-sdk-csharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxT-Team%2Fuapi-sdk-csharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxT-Team%2Fuapi-sdk-csharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AxT-Team","download_url":"https://codeload.github.com/AxT-Team/uapi-sdk-csharp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxT-Team%2Fuapi-sdk-csharp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31835821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T07:17:56.427Z","status":"ssl_error","status_checked_at":"2026-04-15T07:17:30.007Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-client","csharp","dotnet","sdk","uapi"],"created_at":"2025-11-16T20:01:30.310Z","updated_at":"2026-04-15T10:03:33.654Z","avatar_url":"https://github.com/AxT-Team.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# uapi-sdk-csharp\n\n![Banner](https://raw.githubusercontent.com/uapis/uapi-sdk-csharp/main/banner.png)\n\n[![.NET](https://img.shields.io/badge/.NET-7+-512BD4?style=flat-square\u0026logo=dotnet\u0026logoColor=white)](https://dotnet.microsoft.com/)\n[![Docs](https://img.shields.io/badge/Docs-uapis.cn-2EAE5D?style=flat-square)](https://uapis.cn/)\n\n\u003e [!NOTE]\n\u003e 所有接口的 C# 示例都可以在 [UApi](https://uapis.cn/docs/introduction) 的接口文档页面，向下滚动至 **快速启动** 区块后直接复制。\n\n## 快速开始\n\n```bash\ndotnet add package uapi-sdk-csharp\n```\n\n```csharp\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing uapi;\n\nvar client = new Client(\"https://uapis.cn\", \"YOUR_API_KEY\");\n\ntry\n{\n    var result = await client.Misc.getMiscHotboardAsync(new Dictionary\u003cstring, object?\u003e\n        {\n            [\"type\"] = \"weibo\",\n            [\"time\"] = 0,\n            [\"keyword\"] = \"\",\n            [\"time_start\"] = 0,\n            [\"time_end\"] = 0,\n            [\"limit\"] = 0,\n            [\"sources\"] = false\n        });\n    Console.WriteLine($\"Response: {result}\");\n}\ncatch (UapiError ex)\n{\n    Console.Error.WriteLine($\"API call failed: {ex.Message}\");\n}\ncatch (Exception ex)\n{\n    Console.Error.WriteLine($\"Transport error: {ex.Message}\");\n}\n```\n\n## 特性\n\n现在你不再需要反反复复的查阅文档了。\n\n只需在 IDE 中键入 `client.`，所有核心模块——如 `Social`、`Game`、`Image`——即刻同步展现。进一步输入即可直接定位到 `getSocialQqUserinfoAsync` 这样的具体方法，其名称与文档的 `operationId` 严格保持一致，确保了开发过程的直观与高效。\n\n所有方法签名只接受真实且必需的参数。当你在构建请求时，IDE 会即时提示 `qq`、`username` 等键名，这彻底杜绝了在 `Dictionary\u003cstring, object?\u003e` 中因键名拼写错误而导致的运行时错误。\n\n针对 401、404、429 等标准 HTTP 响应，SDK 已将其统一映射为具名的异常类型。这些异常均附带 `Code`、`Status`、`Details` 等关键上下文信息，确保你在日志中能第一时间准确、快速地诊断问题。\n\n`Client` 基于 `HttpClient`，构造函数会设置 BaseAddress 并自动追加 `Authorization` 头；如果你想引入代理、超时或重试策略，只需包装一个自定义的 `HttpClient` 传入即可。\n\n如果你需要查看字段细节或内部逻辑，仓库中的 `./internal` 目录同步保留了由 `openapi-generator` 生成的完整结构体，随时可供参考。\n\n## 错误模型概览\n\n| HTTP 状态码 | SDK 错误类型                                  | 附加信息                                                                          |\n|-------------|----------------------------------------------|------------------------------------------------------------------------------------|\n| 401/403     | `UnauthorizedError`                          | `code`、`status`                                                                   |\n| 404         | `NotFoundError` / `NoMatchError`             | `code`、`status`                                                                   |\n| 400         | `InvalidParameterError` / `InvalidParamsError` | `code`、`status`、`details`                                                        |\n| 429         | `ServiceBusyError`                           | `code`、`status`、`retry_after_seconds`                                            |\n| 5xx         | `InternalServerErrorError` / `ApiErrorError` | `code`、`status`、`details`                                                        |\n| 其他 4xx    | `UapiError`                                  | `code`、`status`、`details`                                                        |\n\n## 其他 SDK\n\n| 语言        | 仓库地址                                                     |\n|-------------|--------------------------------------------------------------|\n| Go          | https://github.com/AxT-Team/uapi-sdk-go                      |\n| Python      | https://github.com/AxT-Team/uapi-sdk-python                  |\n| TypeScript| https://github.com/AxT-Team/uapi-sdk-typescript           |\n| Browser (TypeScript/JavaScript)| https://github.com/AxT-Team/uapi-browser-sdk        |\n| Java        | https://github.com/AxT-Team/uapi-sdk-java                    |\n| PHP         | https://github.com/AxT-Team/uapi-sdk-php                     |\n| C#（当前）          | https://github.com/AxT-Team/uapi-sdk-csharp                  |\n| C++         | https://github.com/AxT-Team/uapi-sdk-cpp                     |\n| Rust        | https://github.com/AxT-Team/uapi-sdk-rust                    |\n\n## 文档\n\n访问 [UApi文档首页](https://uapis.cn/docs/introduction) 并选择任意接口，向下滚动到 **快速启动** 区块即可看到最新的 C# 示例代码。\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxt-team%2Fuapi-sdk-csharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxt-team%2Fuapi-sdk-csharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxt-team%2Fuapi-sdk-csharp/lists"}