This Swift package provides a client library for interacting with the iTunes Search API. It leverages the power of Swift OpenAPI Generator to automatically generate code from the provided OpenAPI specification file (openapi.yaml).
- Fetch app information by bundle ID and optional country code.
- Handles different response formats (JSON and JSONP).
- Throws informative errors for server errors and not found cases.
- Add the package dependency to your Package.swift file:
dependencies: [
.package(url: "https://github.com/LLCFreedom-Space/fs-itunes-search-client", from: "1.0.0")
]
- Import the library in your Swift code:
import ITunesSearchClient
Here's an example of how to use the ITunesSearchClient to fetch information about an app:
let client = try ITunesSearchClient()
do {
let appInfo = try await client.fetchAppInfo(by: "com.example.MyApp")
print("App Version: \(appInfo.version ?? "Not available")")
print("Bundle ID: \(appInfo.bundleId!)")
// ... access other properties of AppInfo
} catch {
print("Error fetching app info: \(error)")
}
We welcome contributions to this project! Please feel free to open issues or pull requests to help improve the package.
LLC Freedom Space – @LLCFreedomSpace – [email protected]
Distributed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3. See LICENSE.md for more information.