Swiftpack.co -  Package - benjaminbruch/Rick-and-Morty-Swift-API
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Swift implementation for the Rick and Morty API https://rickandmortyapi.com/
.package(url: "https://github.com/benjaminbruch/Rick-and-Morty-Swift-API.git", from: "v2.0")

The Rick and Morty API Swift Client

Swift implementation to the awesome Rick and Morty API

build status codecoverage license

Table of Contents


For instructions how to add a Swift package to your projects look here:

Apple - Adding package dependencies to your app


Example to get all characters as an array of character struct:

1. Init client:

let rmClient = RMClient()

2. Call character struct with function

 var cancellable: AnyCancellable?
 cancellable = rmClient.character().getAllCharacters()
            .sink(receiveCompletion: { _ in }, receiveValue: { characters in
                characters.forEach() { print ($0.name) }

For more examples, please refer to the Documentation or visit Test Section


Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the repo and create your branch from master.
  2. If you've added code that should be tested, add tests.
  3. If you've changed APIs, update the documentation.
  4. Ensure the test suite passes.
  5. Issue that pull request!


Distributed under the MIT License. See LICENSE for more information.





Stars: 10
Last commit: 1 week ago

Release Notes

v2.0 Combine
1 week ago

The api client has been updated to latest Swift Combine architecture. For more information how to use, please refer to package readme.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco