Swiftpack.co - misteu/plantnet-swift as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by misteu.
misteu/plantnet-swift 0.1.0
Unofficial Swift package for [email protected] API
⭐️ 1
🕓 49 weeks ago
.package(url: "https://github.com/misteu/plantnet-swift.git", from: "0.1.0")


Unofficial Swift Package for communicating with [email protected] API.

To get access to the API you need an API key. See [https://my.plantnet.org/account/doc] for API docs and setting up access in general.

Setup the package

Before being able to call the endpoints you need to configure the package with your API key via:



Currently, not all endpoints (as specified here: [https://my.plantnet.org/account/doc#openapi]) are supported. Also the decoded data might be limited.

The currently supported endpoints are: POST /v2/identify/{project}, GET /v2/species and GET /v2/projects

If you need more of the endpoints or anything else, please open an issue.

Plant Identification

Example: Post a UIImage via multipart form request for plant identification. languageCode is optional, "en" is the default if nothing is passed.

PlantNet.postIdentify(image: image, languageCode: "de").request(responseType: IdentificationDTO.self) { result in
	if let result = result {
		switch result {
			case .success(let dto):
				let identifications = dto
					.filter({ $0.offset < 10 })
					.map { "\($0.element.species.scientificName) \($0.element.score)" }.joined(separator: "\n")
				print("First ten identifications:\n\(identifications)")
			case .failure(let error):


Stars: 1
Last commit: 6 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

49 weeks ago

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