Connect with us


Papyrus – A type-safe HTTP client for Swift

Papyrus is a type-safe HTTP client for Swift.

It turns your APIs into clean and concise Swift protocols.

protocol GitHub {
    func getRepositories(username: String) async throws -> [Repository]
let provider = Provider(baseURL: "")
let github: GitHub = GitHubAPI(provider: provider)
let repos = try await github.getRepositories(username: "alchemy-swift")

Each function on your protocol represents an endpoint on your API.

Annotations on the protocol, functions, and parameters help construct requests and decode responses.

protocol Users {
    func getUser() async throws -> User

    func createUser(email: String, password: String) async throws -> User


  •  Turn REST APIs into Swift protocols
  •  Generate Swift Concurrency or completion handler based APIs
  •  JSON, URLForm and Multipart encoding
  •  Easy to configure key mapping
  •  Sensible parameter defaults so you can write less code
  •  Automatically decode responses with Codable
  •  Custom Interceptors & Builders
  •  Generate mock APIs for testing
  •  iOS / macOS support powered by Alamofire
  •  Swift on Server support powered by async-http-client
Papyrus on GitHub:
Platform: iOS
⭐️: 117