{"id":1884,"url":"https://github.com/algolia/algoliasearch-client-swift","last_synced_at":"2025-05-16T08:03:24.462Z","repository":{"id":27166507,"uuid":"30636011","full_name":"algolia/algoliasearch-client-swift","owner":"algolia","description":"⚡️ A fully-featured and blazing-fast Swift API client to interact with Algolia.","archived":false,"fork":false,"pushed_at":"2025-05-12T07:53:46.000Z","size":11383,"stargazers_count":205,"open_issues_count":6,"forks_count":69,"subscribers_count":75,"default_branch":"main","last_synced_at":"2025-05-12T08:57:22.845Z","etag":null,"topics":["algolia","ios","search","swift"],"latest_commit_sha":null,"homepage":"","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/algolia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2015-02-11T07:30:57.000Z","updated_at":"2025-05-12T07:53:49.000Z","dependencies_parsed_at":"2025-03-24T10:31:39.852Z","dependency_job_id":"f06b8f6a-d973-4854-9080-faa6139c9d6c","html_url":"https://github.com/algolia/algoliasearch-client-swift","commit_stats":{"total_commits":255,"total_committers":2,"mean_commits":127.5,"dds":"0.0039215686274509665","last_synced_commit":"1135c6be3a65a497c8bce7db37108ffb974b4256"},"previous_names":[],"tags_count":188,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algolia%2Falgoliasearch-client-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algolia%2Falgoliasearch-client-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algolia%2Falgoliasearch-client-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algolia%2Falgoliasearch-client-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/algolia","download_url":"https://codeload.github.com/algolia/algoliasearch-client-swift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493381,"owners_count":22080126,"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":["algolia","ios","search","swift"],"created_at":"2024-01-05T20:15:58.137Z","updated_at":"2025-05-16T08:03:24.437Z","avatar_url":"https://github.com/algolia.png","language":"Swift","funding_links":[],"categories":["SDK","API Clients","Swift"],"sub_categories":["Official","Other free courses"],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.algolia.com\"\u003e\n    \u003cimg alt=\"Algolia for Swift\" src=\"https://raw.githubusercontent.com/algolia/algoliasearch-client-common/master/banners/swift.png\" \u003e\n  \u003c/a\u003e\n\n\u003ch4 align=\"center\"\u003eThe perfect starting point to integrate \u003ca href=\"https://algolia.com\" target=\"_blank\"\u003eAlgolia\u003c/a\u003e within your Swift project\u003c/h4\u003e\n\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/algolia/algoliasearch-client-swift/actions/workflows/tests.yml\"\u003e\n      \u003cimg src=\"https://github.com/algolia/algoliasearch-client-swift/actions/workflows/tests.yml/badge.svg\"\u003e\u003c/img\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://cocoapods.org/pods/AlgoliaSearchClient\"\u003e\n      \u003cimg src=\"http://img.shields.io/cocoapods/v/AlgoliaSearchClient.svg?style=flat\"\u003e\u003c/img\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://cocoapods.org/pods/AlgoliaSearchClient\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/platform-macOS%20%7C%20iOS%20%7C%20tvOS%20%7C%20watchOS%20%7C%20Linux%20-lightgray.svg?style=flat\"\u003e\u003c/img\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/Carthage/Carthage\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/Carthage-compatible-brightgreen.svg\"\u003e\u003c/img\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://developer.apple.com/documentation/xcode/creating_a_mac_version_of_your_ipad_app/\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/Catalyst-compatible-brightgreen.svg\"\u003e\u003c/img\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\"\u003e\u003c/img\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.algolia.com/doc/libraries/swift/\" target=\"_blank\"\u003eDocumentation\u003c/a\u003e  •\n  \u003ca href=\"https://discourse.algolia.com\" target=\"_blank\"\u003eCommunity Forum\u003c/a\u003e  •\n  \u003ca href=\"http://stackoverflow.com/questions/tagged/algolia\" target=\"_blank\"\u003eStack Overflow\u003c/a\u003e  •\n  \u003ca href=\"https://github.com/algolia/algoliasearch-client-swift/issues\" target=\"_blank\"\u003eReport a bug\u003c/a\u003e  •\n  \u003ca href=\"https://www.algolia.com/doc/api-client/troubleshooting/faq/swift/\" target=\"_blank\"\u003eFAQ\u003c/a\u003e  •\n  \u003ca href=\"https://alg.li/support\" target=\"_blank\"\u003eSupport\u003c/a\u003e\n\u003c/p\u003e\n\n## ✨ Features\n\n- Pure cross-platform Swift client\n- Typed requests and responses\n- Widespread use of `Result` type\n- Uses the power of `Codable` protocol for easy integration of your domain models\n- Thread-safe clients\n- Detailed logging\n- Injectable HTTP client\n\n## 💡 Getting Started\n\n### Swift Package Manager\n\nThe Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.\nSince the release of Swift 5 and Xcode 11, SPM is compatible with the iOS, macOS and tvOS build systems for creating apps.\n\nTo use SwiftPM, you should use Xcode 11 to open your project. Click `File` -\u003e `Swift Packages` -\u003e `Add Package Dependency`, enter [the client repo's URL](https://github.com/algolia/algoliasearch-client-swift).\n\nIf you're a framework author and use Swift API Client as a dependency, update your `Package.swift` file:\n\n```swift\nlet package = Package(\n    // 9.0.0 ..\u003c 10.0.0\n    dependencies: [\n        .package(url: \"https://github.com/algolia/algoliasearch-client-swift\", from: \"9.0.0\")\n    ],\n    // ...\n)\n```\n\n### Cocoapods\n\n[CocoaPods](https://cocoapods.org/) is a dependency manager for Cocoa projects.\n\nTo install Algolia Swift Client, simply add the following line to your Podfile:\n\n```ruby\npod 'AlgoliaSearchClient', '~\u003e 9.0.0'\n# pod 'InstantSearchClient', '~\u003e 7.0' // Swift 5.9 NOT YET RELEASED\n```\n\nThen, run the following command:\n\n```bash\n$ pod update\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a simple, decentralized dependency manager for Cocoa.\n\n- To install InstantSearch, simply add the following line to your Cartfile:\n```ruby\ngithub \"algolia/algoliasearch-client-swift\" ~\u003e 9.0.0\n```\n\n- Launch the following commands from the project directory (for v.8.0+)\n ```shell\n carthage update\n ./Carthage/Checkouts/algoliasearch-client-swift/carthage-prebuild\n carthage build\n ```\n\nIf this is your first time using Carthage in the project, you'll need to go through some additional steps as explained [over at Carthage](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application).\n\nYou can now import the Algolia API client in your project and play with it.\n\n\u003e Import the Core package and the required client package to your source code files:\n\n```swift\n#if canImport(Core)\n    import Core\n#endif\nimport Search\n\nlet client = try SearchClient(appID: \"YOUR_APP_ID\", apiKey: \"YOUR_API_KEY\")\n\n// Add a new record to your Algolia index\nlet response = try await client.saveObject(\n    indexName: \"\u003cYOUR_INDEX_NAME\u003e\",\n    body: [\"objectID\": \"id\", \"test\": \"val\"]\n)\n\n// Poll the task status to know when it has been indexed\ntry await client.waitForTask(with: response.taskID, in: \"\u003cYOUR_INDEX_NAME\u003e\")\n\n// Fetch search results, with typo tolerance\nlet response: SearchResponses\u003cHit\u003e = try await client\n    .search(searchMethodParams: SearchMethodParams(requests: [SearchQuery.searchForHits(SearchForHits(\n        query: \"\u003cYOUR_QUERY\u003e\",\n        hitsPerPage: 50,\n        indexName: \"\u003cYOUR_INDEX_NAME\u003e\"\n    ))]))\n```\n\nFor full documentation, visit the **[Algolia Swift API Client](https://www.algolia.com/doc/libraries/swift/)**.\n\n## Notes\n\n### Objective-C support\n\nThe Swift API client is compatible with Objective-C up to version 7.0.5. Please use this version of the client if you're working with an Objective-C project.\n\n### Swift 3\n\nYou can use this library with Swift by one of the following ways:\n\n- `pod 'AlgoliaSearch-Client-Swift', '~\u003e 4.8.1'`\n- `pod 'AlgoliaSearch-Client-Swift', :git =\u003e 'https://github.com/algolia/algoliasearch-client-swift.git', :branch =\u003e 'swift-3'`\n\n### Swift 4\n\nYou can use the old library with Swift by one of the following ways:\n\n- `pod 'AlgoliaSearch-Client-Swift', '~\u003e 8.19'`\n- `pod 'AlgoliaSearch-Client-Swift', :git =\u003e 'https://github.com/algolia/algoliasearch-client-swift.git', :branch =\u003e 'swift-4'`\n\n## ❓ Troubleshooting\n\nEncountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/api-client/troubleshooting/faq/swift/) where you will find answers for the most common issues and gotchas with the client. You can also open [a GitHub issue](https://github.com/algolia/api-clients-automation/issues/new?assignees=\u0026labels=\u0026projects=\u0026template=Bug_report.md)\n\n## Contributing\n\nThis repository hosts the code of the generated Algolia API client for Swift, if you'd like to contribute, head over to the [main repository](https://github.com/algolia/api-clients-automation). You can also find contributing guides on [our documentation website](https://api-clients-automation.netlify.app/docs/introduction).\n\n## 📄 License\n\nThe Algolia Swift API Client is an open-sourced software licensed under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falgolia%2Falgoliasearch-client-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falgolia%2Falgoliasearch-client-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falgolia%2Falgoliasearch-client-swift/lists"}