{"id":13338682,"url":"https://github.com/B-Lach/PocketCastsKit","last_synced_at":"2025-03-11T10:31:43.879Z","repository":{"id":88780271,"uuid":"100507052","full_name":"B-Lach/PocketCastsKit","owner":"B-Lach","description":"Unofficial Pocket Casts API Client written in  Swift","archived":false,"fork":false,"pushed_at":"2017-09-22T09:47:41.000Z","size":111,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-23T22:18:08.966Z","etag":null,"topics":["carthage","ios","macos","pocketcasts","podcast","swift","tvos","xcode"],"latest_commit_sha":null,"homepage":null,"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/B-Lach.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":"2017-08-16T15:56:38.000Z","updated_at":"2024-06-08T02:13:29.000Z","dependencies_parsed_at":"2023-06-12T14:15:15.677Z","dependency_job_id":null,"html_url":"https://github.com/B-Lach/PocketCastsKit","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/B-Lach%2FPocketCastsKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/B-Lach%2FPocketCastsKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/B-Lach%2FPocketCastsKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/B-Lach%2FPocketCastsKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/B-Lach","download_url":"https://codeload.github.com/B-Lach/PocketCastsKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243015428,"owners_count":20222080,"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":["carthage","ios","macos","pocketcasts","podcast","swift","tvos","xcode"],"created_at":"2024-07-29T19:17:08.453Z","updated_at":"2025-03-11T10:31:43.859Z","avatar_url":"https://github.com/B-Lach.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PocketCastsKit\n[![Build Status](https://www.bitrise.io/app/b1a7baab2672d1b7/status.svg?token=puVh6MgHEoHK74nXk0LS9g\u0026branch=develop)](https://www.bitrise.io/app/b1a7baab2672d1b7)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n\u003e PocketCastsKit is an unofficial [Pocket Casts](https://www.shiftyjelly.com/pocketcasts/) API Wrapper written in Swift 4.0 and available for iOS, macOS and tvOS \n\n## Requirements\n\n- iOS 11.0+ / macOS 10.13+ / tvOS 11.0+\n- Xcode 9.0+\n- Swift 4.0+\n\n\n## Installation\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate PocketCastsKit into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"B-Lach/PocketCastsKit\"\n```\n\nRun `carthage update` to build the framework and drag the built `PocketCastsKit.framework` into your Xcode project.\nInstall using Carthage as usual:\n\n### Manually\n\nIf you prefer not to use Carthage, you can integrate PocketCastsKit into your project manually by cloning the repository and build the needed target.\n\n## Models\n\n### PCKCountry\n\nRepresents a country available in Pocket Casts\n\n```swift\npublic struct PCKCountry {\n    public let code: String\n    public let name: String\n}\n```\n### PCKCategory\n\nRepresents a category in Pocket Casts\n\n```swift \npublic struct PCKCategory {\n    public let id: Int\n    public let name: String\n}\n```\n\n### PCKCategoryContent\n\nRepresents a child of a `PCKCategory`. In a nutshell it's just a simplified version of `PCKPodcast`. If you want a more detailed version request `PCKClient.shared.getPodcast(with: PCKCategoryContent.uuid)`\n\n```swift\npublic struct PCKCategoryContent {\n    public let author: String\n    public let title: String\n    public let collectionId: Int\n    public let description: String\n    public let thumbnail: URL\n    public let uuid: UUID\n}\n```\n\n### PCKNetwork\n\nRepresents a network available in Pocket Casts\n\n```swift\npublic struct PCKNetwork {\n    public let id: Int\n    public let title: String\n    public let description: String\n    public let imgURL: URL\n    public let color: String\n}\n```\n\n### PCKNetworkGroup\n\nRepresents a group of a specific `PCKNetwork`\n\n```swift\npublic struct PCKNetworkGroup {    \n    public let title: String\n    public let description: String\n    public let imgURL: URL\n    // TODO: - No idea so far - private podcast uuid ?\n    public let ppu: UUID\n    public let podcasts: [PCKNetworkPodcast]\n}\n```\n\n### PCKNetworkPodcast\n\nRepresents a Podcast object in a  `PCKNetworkGroup`. In a nutshell, it's just a simplified version of PCKPodcast. If you want a more detailed version request `PCKClient.shared.getPodcast(with: PCKNetworkPodcast.uuid)`\n\n```swift\npublic struct PCKNetworkPodcast {\n    public let uuid: UUID\n    public let fileType: String?\n}\n```\n\n### PCKPodcast\nRepresents a Podcast object in  Pocket Casts\n\n```swift\npublic struct PCKPodcast {\n    public let id: Int\n    public let uuid: UUID\n    public let url: URL?\n    public let title: String\n    public let category: String\n    public let description: String\n    public let mediaType: String\n    public let language: String\n    public let thumbnail: URL\n    public let author: String\n    public let sortOrder: Int\n}\n```\n\n### PCKEpisode\n\nRepresents a specific Episode of a `PCKPodcast`.\n\n```swift\npublic struct PCKEpisode {\n    public let id: Int\n    public let uuid: UUID\n    public let url: URL\n    public let publishedAt: Date\n    public let duration: Int\n    public let fileType: String\n    public let title: String\n    public let size: Int\n    public let podcastId: Int\n    public let podcastUUID: UUID?\n    public var playingStatus: Int\n    public var playedUpTo: Int\n    public var isDeleted: Bool?\n    public var starred: Bool?\n}\n```\n\n## API\n### Usage\n\n#### Store a reference if you want to\n\n```swift\nimport PocketCastskit\n\nlet client = PCKClient.shared\n```\n\n### Unauthorized requests\nThere are some endpoints you can consume without being authenticated.\n\n#### Get Top 100 Podcasts\n\n```swift\nclient.getTop100 { (result) in\n    switch result {\n    case .error(let error):\n        // handle the error\n    case .success(let podcasts):\n        // do anything with the fetched podcasts\n    }\n}\n```\n\n#### Get Featured Podcasts\n\n```swift\nclient.getFeatured { (result) in\n    switch result {\n    case .error(let error):\n        // handle the error\n    case .success(let podcasts):\n        // do anything with the fetched podcasts\n    }\n}\n```\n\n#### Get currently trending Podcasts\n\n```swift\nclient.getTrending { (result) in\n    switch result {\n    case .error(let error):\n        // handle the error\n    case .success(let podcasts):\n        // do anything with the fetched podcasts\n    }\n}\n```\n\n#### Get available Networks\n\n```swift\nclient.getNetworks { (result) in\n    switch result {\n    case .error(let error):\n        // handle the error\n    case .success(let networks):\n        // do anything with the fetched networks\n    }\n}\n```\n\n#### Get all Groups of a Network\n\n```swift\nclient.getNetworkGroups(networkId: 28) { (result) in\n    switch result {\n    case .error(let error):\n        // handle the error\n        print(error)\n    case .success(let groups):\n        // do anything with the fetched groups\n    }\n}\n```\n\n#### Get all available categories and countries\nPodcasts are subdevided into categories which and can be filtered by country.\nTo get a touple of all available categories and countries use this endpoint. \n\n```swift\nclient.getCategoriesAndCountries { (result) in\n    switch result {\n    case .error(let error):\n        // hanlde the error\n        print(error)\n        \n    case .success(let touple):\n        // do anything with the fetched categories and countries\n        \n        // print(touple.categories)\n        // print(touple.countries)\n    }\n}\n```\n\n#### Get all podcasts of a specific category for a given country\nYou will get 50 podcast for each category.\nIt is not possible to fetch all podcast for a category without naming the country.\n\n```swift\nclient.getCategoryContent(categoryId: category.id, countryCode: country.code) { (result) in\n    switch result {\n    case .error(let error):\n        // handle the error\n    case .success(let content):\n        // do anything the fetched category content\n    }\n}\n```\n\n### Authentication\nBefore requesting any user related data you have to authenticate as a valid user\n\n#### Authenticate with email and password\n\n```swift\nclient.authenticate(username: \"foo@example.com\", password: \"bar\") { (result) in\n    switch(result) {\n    case .error(let error):\n        // handle the error\n    case .success(_):\n        // you are authenticated\n    }\n}\n```\n\n#### Check if you are still authenticated\n\n```swift\nclient.isAuthenticated { (result) in\n    switch(result) {\n    case .error(let error):\n        // handle the error\n    case .success(_):\n        // you are authenticated\n    }\n}\n```\n\n### Authorized requests - User feeds\n\n#### Get all subscribed podcast\n\n```swift\nclient.getSubscriptions { (result) in\n    switch(result) {\n    case .error(let error):\n        // handle the error\n    case .success(let podcasts):\n        // do anything with the subscribed podcasts\n    }\n}\n```\n\n#### Get new episodes\n\n```swift\nclient.getNewEpisodes { (result) in\n    switch(result) {\n    case .error(let error):\n        // handle the error\n    case .success(let episodes):\n        // do anything with the new episodes\n    }\n}\n```\n\n#### Get episodes in progress\n\n```swift\nclient.getEpisodesInProgress { (result) in\n    switch(result) {\n    case .error(let error):\n        // handle the error\n    case .success(let episodes):\n        // do anything with the fetched episodes currently in progress\n    }\n}\n```\n\n#### Get starred episodes\n\n```swift\nclient.getStarredEpisodes { (result) in\n    switch(result) {\n    case .error(let error):\n        // handle the error\n    case .success(let episodes):\n        // do anything with the starred episodes \n    }\n}\n```\n\n### Authenticated requests - Podcast actions\n\n#### Search Podcast by String\n\n```swift\nclient.searchPodcasts(by: \"apple\") { (result) in\n        switch(result) {\n        case .error(let error):\n            // handle the error\n        case .success(let podcasts):\n            // do anything with the found podcasts\n        }\n}\n```\n\n#### Get Podcast by UUID\n\n```swift\nclient.getPodcast(with: uuid) { (result) in\n    switch(result) {\n    case .error(let error):\n        // handle the error\n    case .success(let podcast):\n        // do anything with the found podcast\n    }\n}\n```\n\n#### Get Episodes of a specific Podcast\nBy default this request will fetch the first page of the available episodes sorted from newest to oldest (descending)\nDue to pagination you are able to define which page you want to fetch.You are able to change the sorting as well.\n##### Default\n\n```swift\nclient.getEpisodes(for: uuid) { (result) in\n    switch(result) {\n    case .error(let error):\n        // handle the error\n        print(error)\n    case .success(let epsidodes):\n        // do anything with the fetched episodes\n    }\n}\n\n```\n\n##### Custom\n\n```swift\nclient.getEpisodes(for: uuid, page: 2, order: SortOrder.ascending) { (result) in\n    switch(result) {\n    case .error(let error):\n        // handle the error\n    case .success(let podcast):\n        // do anything with the fetched episodes\n    }\n}\n```\n\n#### Subscribe to a Podcast by UUID\n\n```swift\nclient.subscribe(podcast: uuid) { (result) in\n    switch(result) {\n    case .error(let error):\n        // handle the error\n    case .success(_):\n    \t // Successfully subscribed to the Podcast\n    }\n}\n```\n\n#### Unsubscribe from a Podcast by UUID\n\n```swift\nclient.unsubscribe(podcast: uuid) { (result) in\n    switch(result) {\n    case .error(let error):\n        // handle the error\n        print(error)\n    case .success(_):\n        // Successfully unsubscribed from the Podcast\n    }\n}\n```\n\n### Authenticated requests - Episode actions\n\n#### Get Episode by UUID\nTo fetch a specific Episode you have to know its UUID and the UUID of the Podcast the Episode belongs to.\n\n```swift\nclient.getEpisode(with: episode_uuid, of: podcast_uuid) { (result) in\n    switch result {\n    case .error(let error):\n        // handle the error\n    case .success(let episode):\n        // do anything with the fetched episode\n    }\n}\n```\n\n#### Get Show Notes of an Episode\n\n```swift\nclient.getShowNotes(for: episode_uuid) { (result) in\n    switch result {\n    case .error(let error):\n    // handle the error\n    case .success(let notes):\n        // do anything with the fetched string\n    }\n}\n```\n\n#### Update the playing position for an Episode\n\n```swift\nclient.setPlayingPosition(for: episode_uuid, podcast: podcast_uuid, position: 300) { (result) in\n    switch result {\n    case .error(let error):\n    // handle the error\n    case .success(_):\n        // Successfully updated the position\n    }\n}\n```\n\n#### Update the playing status for an Episode\n\nThe status can be on of `PlayingStatus.unplayed`,  `PlayingStatus.playing` or \n`PlayingStatus.played`\n\n```swift\nclient.setPlayingStatus(for: episode_uuid, podcast: podcast_uuid, status: status) { (result) in\n    switch result {\n    case .error(let error):\n    // handle the error\n    case .success(_):\n        // Successfully updated the status\n    }\n}\n```\n\n#### Update the starred status for an Episode\n\nYou are able to star or unstar an episode\n\n```swift\nclient.setStarred(for: episode_uuid, podcast: podcast_uuid, starred: true/false) { (result) in\n    switch result {\n    case .error(let error):\n    // handle the error\n    case .success(_):\n        // Successfully updated the starred status\n    }\n}\n```\n## Contributing\n\n\u003e If you found a bug or have a feature request, feel free to create a pull request.\n\n##\nPocketCastsKit is released under the MIT license. [See LICENSE](https://github.com/B-Lach/PocketCastsKit/blob/develop/LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FB-Lach%2FPocketCastsKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FB-Lach%2FPocketCastsKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FB-Lach%2FPocketCastsKit/lists"}