{"id":15293507,"url":"https://github.com/isaced/v2exapi","last_synced_at":"2025-09-01T03:08:46.556Z","repository":{"id":49318528,"uuid":"517284606","full_name":"isaced/V2exAPI","owner":"isaced","description":"V2ex API 的 Swift 封装，支持 iOS/macOS (A V2ex API wrapper for iOS/macOS, built with Swift)","archived":false,"fork":false,"pushed_at":"2023-08-29T15:49:44.000Z","size":37,"stargazers_count":50,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-20T06:33:24.447Z","etag":null,"topics":["swift","v2ex","v2ex-api"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isaced.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}},"created_at":"2022-07-24T09:52:42.000Z","updated_at":"2025-08-19T13:46:05.000Z","dependencies_parsed_at":"2024-05-31T16:25:12.183Z","dependency_job_id":null,"html_url":"https://github.com/isaced/V2exAPI","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":"0.025000000000000022","last_synced_commit":"910c1b52c03ba481f90067c433b78fc0c848d4e8"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/isaced/V2exAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaced%2FV2exAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaced%2FV2exAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaced%2FV2exAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaced%2FV2exAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isaced","download_url":"https://codeload.github.com/isaced/V2exAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaced%2FV2exAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273068858,"owners_count":25039911,"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-09-01T02:00:09.058Z","response_time":120,"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":["swift","v2ex","v2ex-api"],"created_at":"2024-09-30T16:49:48.517Z","updated_at":"2025-09-01T03:08:46.516Z","avatar_url":"https://github.com/isaced.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# V2exAPI\n[![Swift](https://img.shields.io/badge/swift-F54A2A?style=for-the-badge\u0026logo=swift\u0026logoColor=white)](https://github.com/isaced/V2exAPI)\n[![CocoaPods](https://img.shields.io/cocoapods/v/V2exAPI.svg?style=for-the-badge)](https://cocoapods.org/pods/V2exAPI)\n[![Carthage](https://img.shields.io/badge/-Carthage-5C5543?style=for-the-badge)](https://github.com/Carthage/Carthage)\n[![iOS](https://img.shields.io/badge/iOS-000000?style=for-the-badge\u0026logo=ios\u0026logoColor=white)](https://github.com/isaced/V2exAPI)\n[![macOS](https://img.shields.io/badge/mac%20os-000000?style=for-the-badge\u0026logo=macos\u0026logoColor=F0F0F0)](https://github.com/isaced/V2exAPI)\n\n中文｜[English](/README_EN.md)\n\n一个 [V2ex](https://v2ex.com/) API 的 Swift 封装，支持 iOS/macOS，支持 SPM 引入和 async/await 方式调用。\n\n## 特性\n\n- [x] SPM(Swift Package Manager) 支持\n- [x] Swift async/await 异步 API\n- [x] V2ex API V1 支持度 100%\n- [x] V2ex API V2 支持度 100%\n- [x] Zero dependency 零三方依赖\n\n## API 支持范围\n\n### V1\n\n| 接口   | 路径                   | 进度  |\n|------|-------------------------|-----|\n| 最热主题 | /api/topics/hot.json    | \u0026#9745; |\n| 最新主题 | /api/topics/latest.json | \u0026#9745; |\n| 节点列表 | /api/nodes/list.json    | \u0026#9745; |\n| 节点信息 | /api/nodes/show.json    | \u0026#9745; |\n| 用户主页 | /api/members/show.json  | \u0026#9745; |\n| 回复列表 | /api/replies/show.json  | \u0026#9745; |\n\n### V2\n\n| 接口            | 路径                           | 进度 |\n|----------------------|--------------------------------|---------|\n| 获取最新的提醒       | notifications                  | \u0026#9745; |\n| 删除指定的提醒       | notifications/:notification_id | \u0026#9745; |\n| 获取自己的 Profile   | member                         | \u0026#9745; |\n| 查看当前使用的令牌   | token                          | \u0026#9745; |\n| 获取指定节点         | nodes/:node_name               | \u0026#9745; |\n| 获取指定节点下的主题 | nodes/:node_name/topics        | \u0026#9745; |\n| 获取指定主题         | topics/:topic_id               | \u0026#9745; |\n| 获取指定主题下的回复 | topics/:topic_id/replies       | \u0026#9745; |\n\n## 安装\n\n### Swift Package Manager\n\n通过 [Swift Package Manager](https://swift.org/package-manager/) 安装 V2exAPI 到你的项目，在 `Package.swift` 中添加：\n\n```swift\n.package(name: \"V2exAPI\", url: \"git@github.com:isaced/V2exAPI.git\", .upToNextMinor(from: \"1.0.0\")),\n```\n\n在 Xcode 中：\n- 菜单 File \u003e Swift Packages \u003e Add Package Dependency\n- 搜索 https://github.com/isaced/V2exAPI.git\n- 选择 \"Up to Next Major\" 版本 \"1.0.0\"\n\n\n### CocoaPods\n\n```ruby\npod 'V2exAPI', '~\u003e 1.0'\n```\n\n## 使用\n\n```swift\nimport V2exAPI\n\n// 初始化 V2eXAPI 对象 \nlet v2ex = V2exAPI(accessToken: \"XXXXX-XXXX-XXXX-XXXX-XXXXXXXXX\")\n\n// 获取节点列表\nlet nodes = try await v2ex.nodesList()\n\n// 获取最新主题\nlet latest = try await v2ex.latestTopics()\n\n// 获取指定节点下的主题列表\nlet topics = try await v2ex.topics(nodeName: \"swift\", page: 1)\n\n// 获取指定主题下的回复\nlet replies = try await v2ex.replies(topicId: 870607, page: 1)\n```\n\n## API 参考\n\n- [V2EX API 接口](https://www.v2ex.com/p/7v9TEc53)\n- [API 2.0 Beta](https://v2ex.com/help/api)\n\nAPI Rate Limit\n\n默认情况下，每个 IP 每小时可以发起的 API 请求数被限制在 120 次。你可以在 API 返回结果的 HTTP 头部找到 Rate Limit 信息：\n\n```\nX-Rate-Limit-Limit: 120\nX-Rate-Limit-Reset: 1409479200\nX-Rate-Limit-Remaining: 116\n```\n\n对于能够被 CDN 缓存的 API 请求，只有第一次请求时，才会消耗 Rate Limit 配额。\n\n\u003e Personal Access Token 申请参考：https://v2ex.com/help/personal-access-token\n\n## 使用示例\n\n- [V2exOS](https://github.com/isaced/V2exOS) - 一个用 SwiftUI 编写的 V2ex macOS 客户端\n\n![screenshot](https://user-images.githubusercontent.com/2088605/192312063-def16466-052b-457a-9b4c-856b2afb3a42.png#gh-dark-mode-only)\n![screenshot](https://user-images.githubusercontent.com/2088605/192312051-9ec1e43d-4aee-46fb-a61f-fd865e35fca4.png##gh-light-mode-only)\n\n## License\n\nV2exAPI 在 MIT 许可下发布的，有关详细信息，请参阅 [LICENSE](/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaced%2Fv2exapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisaced%2Fv2exapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaced%2Fv2exapi/lists"}