{"id":20059982,"url":"https://github.com/chrisdhaan/cdyelpfusionkit","last_synced_at":"2025-05-05T15:32:07.544Z","repository":{"id":12881573,"uuid":"73038221","full_name":"chrisdhaan/CDYelpFusionKit","owner":"chrisdhaan","description":"An extensive Swift wrapper for the Yelp Fusion API.","archived":false,"fork":false,"pushed_at":"2023-02-20T14:21:53.000Z","size":1348,"stargazers_count":55,"open_issues_count":5,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-09T00:51:25.320Z","etag":null,"topics":["api","carthage","cocoapods","ios","macos","swift","swift-package-manager","tvos","watchos","wrapper","xcode","yelp"],"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/chrisdhaan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-11-07T03:15:40.000Z","updated_at":"2024-11-21T00:36:14.000Z","dependencies_parsed_at":"2023-01-11T20:19:26.971Z","dependency_job_id":"35eeb1da-4788-4420-b301-b5224b997a0a","html_url":"https://github.com/chrisdhaan/CDYelpFusionKit","commit_stats":{"total_commits":116,"total_committers":2,"mean_commits":58.0,"dds":"0.017241379310344862","last_synced_commit":"4a7c2ceaffd602db9899f8c6b98da6b83f1d1157"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisdhaan%2FCDYelpFusionKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisdhaan%2FCDYelpFusionKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisdhaan%2FCDYelpFusionKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisdhaan%2FCDYelpFusionKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisdhaan","download_url":"https://codeload.github.com/chrisdhaan/CDYelpFusionKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252524171,"owners_count":21762043,"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":["api","carthage","cocoapods","ios","macos","swift","swift-package-manager","tvos","watchos","wrapper","xcode","yelp"],"created_at":"2024-11-13T13:11:25.773Z","updated_at":"2025-05-05T15:32:07.162Z","avatar_url":"https://github.com/chrisdhaan.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/chrisdhaan/CDYelpFusionKit\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/chrisdhaan/CDYelpFusionKit/master/Documentation/cdyelpfusionkit.png\" alt=\"CDYelpFusionKit\" width=\"850\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/chrisdhaan/CDYelpFusionKit\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/chrisdhaan/CDYelpFusionKit/master/Documentation/github.png\" alt=\"Star CDYelpFusionKit On Github\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://stackoverflow.com/questions/tagged/cdyelpfusionkit\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/chrisdhaan/CDYelpFusionKit/master/Documentation/stackoverflow.png\" alt=\"Stack Overflow\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/chrisdhaan/CDYelpFusionKit/actions/workflows/ci.yml\"\u003e\n        \u003cimg src=\"https://github.com/chrisdhaan/CDYelpFusionKit/actions/workflows/ci.yml/badge.svg\" alt=\"CI Status\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/chrisdhaan/CDYelpFusionKit/releases\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/release/chrisdhaan/CDYelpFusionKit.svg\" alt=\"GitHub Release\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.swift.org\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Swift-5.3_5.4_5.5_5.6-orange?style=flat\" alt=\"Swift Versions\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://cocoapods.org/pods/CDYelpFusionKit\"\u003e\n        \u003cimg src=\"https://img.shields.io/cocoapods/p/CDYelpFusionKit.svg?style=flat\" alt=\"Platforms\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://cocoapods.org/pods/CDYelpFusionKit\"\u003e\n        \u003cimg src=\"https://img.shields.io/cocoapods/v/CDYelpFusionKit.svg?style=flat\" alt=\"CocoaPods Compatible\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/Carthage/Carthage\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat\" alt=\"Carthage Compatible\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.swift.org/package-manager\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat\" alt=\"Swift Package Manager Compatible\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://cocoapods.org/pods/CDYelpFusionKit\"\u003e\n        \u003cimg src=\"https://img.shields.io/cocoapods/l/CDYelpFusionKit.svg?style=flat\" alt=\"License\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\nThis Swift wrapper covers all possible network endpoints and responses for the Yelp Fusion API.\n\nFor a demonstration of the capabilities of CDYelpFusionKit; run the iOS Example project after cloning the repo.\n\n- [Features](#features)\n- [Requirements](#requirements)\n- [Dependencies](#dependencies)\n- [Installation](#installation)\n- [Contributing](#contributing)\n- [Usage](#usage)\n    - [Initialization](#initialization)\n    - [Search Endpoint](#search-endpoint)\n    - [Phone Search Endpoint](#phone-search-endpoint)\n    - [Transaction Search Endpoint](#transaction-search-endpoint)\n    - [Business Endpoint](#business-endpoint)\n    - [Business Match Endpoint](#business-match-endpoint)\n    - [Reviews Endpoint](#reviews-endpoint)\n    - [Autocomplete Endpoint](#autocomplete-endpoint)\n    - [Event Lookup Endpoint](#event-lookup)\n    - [Event Search Endpoint](#event-search-endpoint)\n    - [Featured Event Endpoint](#featured-event-endpoint)\n    - [All Categories Endpoint](#all-categories-endpoint)\n    - [Category Details Endpoint](#category-details-endpoint)\n    - [Deep Linking](#deep-linking)\n    - [Web Linking](#web-linking)\n    - [Brand Assets](#brand-assets)\n- [Author](#author)\n- [Resources](#resources)\n- [License](#license)\n\n---\n\n## Features\n\n- [x] Authentication\n- [x] API Endpoints\n    - [x] Search\n    - [x] Phone Search\n    - [x] Transaction Search\n    - [x] Business\n    - [x] Business Match\n    - [x] Reviews\n    - [x] Autocomplete\n    - [x] Event Lookup\n    - [x] Event Search\n    - [x] Featured Event\n    - [x] All Categories\n    - [x] Category Details\n- [x] Deep Linking\n- [x] Web Linking\n- [x] Brand Assets\n    - [x] Color\n    - [x] Logos\n- [x] Platform Support\n    - [x] iOS\n    - [x] macOS\n    - [x] tvOS\n    - [x] watchOS\n- [x] Documentation\n\n---\n\n## Requirements\n\n- iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+\n- Swift 5.3+\n- [Yelp API Access](https://www.yelp.com/developers/v3/manage_app)\n\n---\n\n## Dependencies\n\n- [Alamofire](https://github.com/Alamofire/Alamofire)\n\n---\n\n## Installation\n\n### CocoaPods\n\n[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate CDYelpFusionKit into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\npod 'CDYelpFusionKit', '3.2.0'\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate CDYelpFusionKit into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"chrisdhaan/CDYelpFusionKit\" == 3.2.0\n```\n\n### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.\n\nOnce you have your Swift package set up, adding CDYelpFusionKit as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/chrisdhaan/CDYelpFusionKit.git\", .upToNextMajor(from: \"3.2.0\"))\n]\n```\n\n### Git Submodule\n\nIf you prefer not to use any of the aforementioned dependency managers, you can integrate CDYelpFusionKit into your project manually.\n\n- Open up Terminal, `cd` into your top-level project directory, and run the following command \"if\" your project is not initialized as a git repository:\n\n```bash\n$ git init\n```\n\n- Add CDYelpFusionKit as a git [submodule](https://git-scm.com/docs/git-submodule) by running the following command:\n\n```git\ngit submodule add https://github.com/chrisdhaan/CDYelpFusionKit.git\n```\n\n- Open the new `CDYelpFusionKit` folder, and drag the `CDYelpFusionKit.xcodeproj` into the Project Navigator of your application's Xcode project.\n\n    \u003e It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter.\n\n- Select the `CDYelpFusionKit.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target.\n- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the \"Targets\" heading in the sidebar.\n- In the tab bar at the top of that window, open the \"General\" panel.\n- Click on the `+` button under the \"Embedded Binaries\" section.\n- You will see two different `CDYelpFusionKit.xcodeproj` folders each with two different versions of the `CDYelpFusionKit.framework` nested inside a `Products` folder.\n\n    \u003e It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `CDYelpFusionKit.framework`.\n\n- Select the top `CDYelpFusionKit.framework` for iOS and the bottom one for macOS.\n\n    \u003e You can verify which one you selected by inspecting the build log for your project. The build target for `CDYelpFusionKit` will be listed as either `CDYelpFusionKit iOS`, `CDYelpFusionKit macOS`, `CDYelpFusionKit tvOS` or `CDYelpFusionKit watchOS`.\n\n- And that's it!\n\n  \u003e The `CDYelpFusionKit.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device.\n\n---\n\n## Contributing\n\nBefore contributing to CDYelpFusionKit, please read the instructions detailed in our [contribution guide](https://github.com/chrisdhaan/CDYelpFusionKit/blob/master/CONTRIBUTING.md).\n\n---\n\n## Usage\n\n### Initialization\n\n```swift\nlet yelpAPIClient = CDYelpAPIClient(apiKey: \"YOUR_API_KEY\")\n```\n\nOnce you've created a CDYelpAPIClient object you can use it to query the Yelp Fusion API using any of the following methods.\n\n- Parameters with `// Optional` can take nil as a value.\n- Parameters with `// Required` will throw an exception when passing nil as a value.\n\n### [Search Endpoint](https://www.yelp.com/developers/documentation/v3/business_search)\n\n```swift\npublic func searchBusinesses(byTerm term: String?,                 // Optional\n                             location: String?,                    // Optional\n                             latitude: Double?,                    // Optional\n                             longitude: Double?,                   // Optional\n                             radius: Int?,                         // Optional - Max = 40000\n                             categories: [CDYelpCategoryAlias]?,   // Optional\n                             locale: CDYelpLocale?,                // Optional\n                             limit: Int?,                          // Optional - Default = 20, Max = 50\n                             offset: Int?,                         // Optional\n                             sortBy: CDYelpBusinessSortType?,      // Optional - Default = .bestMatch\n                             priceTiers: [CDYelpPriceTier]?,       // Optional\n                             openNow: Bool?,                       // Optional - Default = false\n                             openAt: Int?,                         // Optional\n                             attributes: [CDYelpAttributeFilter]?, // Optional\n                             completion: @escaping (CDYelpSearchResponse.Business?) -\u003e Void);\n```\n\nThe search endpoint has a `categories` parameter which allows for query results to be returned based off one thousand four hundred and sixty-one types of categories. The full list of categories can be found in `CDYelpEnums.swift`. The following lines of code show an example of a category that can be passed into the `categories` parameter.\n\n```swift\nCDYelpCategoryAlias.activeLife\n```\n\nThe search endpoint has a `locale` parameter which allows for query results to be returned based off forty-two types of language and country codes. The following lines of code show which locales can be passed into the `locale` parameter.\n\n```swift\nCDYelpLocale.chinese_hongKong\nCDYelpLocale.chinese_taiwan\nCDYelpLocale.czech_czechRepublic\nCDYelpLocale.danish_denmark\nCDYelpLocale.dutch_belgium\nCDYelpLocale.dutch_theNetherlands\nCDYelpLocale.english_australia\nCDYelpLocale.english_belgium\nCDYelpLocale.english_canada\nCDYelpLocale.english_hongKong\nCDYelpLocale.english_malaysia\nCDYelpLocale.english_newZealand\nCDYelpLocale.english_philippines\nCDYelpLocale.english_republicOfIreland\nCDYelpLocale.english_singapore\nCDYelpLocale.english_switzerland\nCDYelpLocale.english_unitedKingdom\nCDYelpLocale.english_unitedStates\nCDYelpLocale.filipino_philippines\nCDYelpLocale.finnish_finland\nCDYelpLocale.french_belgium\nCDYelpLocale.french_canada\nCDYelpLocale.french_france\nCDYelpLocale.french_switzerland\nCDYelpLocale.german_austria\nCDYelpLocale.german_germany\nCDYelpLocale.german_switzerland\nCDYelpLocale.italian_italy\nCDYelpLocale.italian_switzerland\nCDYelpLocale.japanese_japan\nCDYelpLocale.malay_malaysia\nCDYelpLocale.norwegian_norway\nCDYelpLocale.polish_poland\nCDYelpLocale.portuguese_brazil\nCDYelpLocale.portuguese_portugal\nCDYelpLocale.spanish_argentina\nCDYelpLocale.spanish_chile\nCDYelpLocale.spanish_mexico\nCDYelpLocale.spanish_spain\nCDYelpLocale.swedish_finland\nCDYelpLocale.swedish_sweden\nCDYelpLocale.turkish_turkey\n```\n\nThe search endpoint has a `sortBy` parameter which allows for query results to be filtered based off four types of criteria. The following lines of code show which sort types can be passed into the `sortBy` parameter.\n\n```swift\nCDYelpBusinessSortType.bestMatch // Default\nCDYelpBusinessSortType.rating\nCDYelpBusinessSortType.reviewCount\nCDYelpBusinessSortType.distance\n```\n\nThe search endpoint has a `price` parameter which allows for query results to be filtered based off four types of criteria. The following lines of code show which price tiers can be passed into the `priceTiers` parameter.\n\n```swift\nCDYelpPriceTier.oneDollarSign\nCDYelpPriceTier.twoDollarSigns\nCDYelpPriceTier.threeDollarSigns\nCDYelpPriceTier.fourDollarSigns\n```\n\nThe search endpoint has an `attributes` parameter which allows for query results to be filtered based off five types of criteria. The following lines of code show which attributes can be passed into the `attributes` parameter.\n\n```swift\nCDYelpAttributeFilter.hotAndNew\nCDYelpAttributeFilter.requestAQuote\nCDYelpAttributeFilter.reservation\nCDYelpAttributeFilter.waitlistReservation\nCDYelpAttributeFilter.deals\nCDYelpAttributeFilter.genderNeutralRestrooms\nCDYelpAttributeFilter.openToAll\nCDYelpAttributeFilter.wheelchairAccessible\n```\n\nThe following lines of code show an example query to the search endpoint.\n\n```swift\n// Cancel any API requests previously made\nyelpAPIClient.cancelAllPendingAPIRequests()\n// Query Yelp Fusion API for business results\nyelpAPIClient.searchBusinesses(byTerm: \"Food\",\n                               location: \"San Francisco\",\n                               latitude: nil,\n                               longitude: nil,\n                               radius: 10000,\n                               categories: [.activeLife, .food],\n                               locale: .english_unitedStates,\n                               limit: 5,\n                               offset: 0,\n                               sortBy: .rating,\n                               priceTiers: [.oneDollarSign, .twoDollarSigns],\n                               openNow: true,\n                               openAt: nil,\n                               attributes: nil) { (response) in\n\n  if let response = response,\n      let businesses = response.businesses,\n      businesses.count \u003e 0 {\n      print(businesses)\n  }\n}\n```\n\n### [Phone Search Endpoint](https://www.yelp.com/developers/documentation/v3/business_search_phone)\n\n```swift\npublic func searchBusinesses(byPhoneNumber phoneNumber: String!, // Required\n                             completion: @escaping (CDYelpSearchResponse.Phone?) -\u003e Void)\n```\n\nThe following lines of code show an example query to the phone search endpoint.\n\n```swift\nyelpAPIClient.searchBusinesses(byPhoneNumber: \"+14157492060\") { (response) in\n\n  if let response = response,\n      let businesses = response.businesses,\n      businesses.count \u003e 0 {\n      print(businesses)\n  }\n}\n```\n\n### [Transaction Search Endpoint](https://www.yelp.com/developers/documentation/v3/transactions_search)\n\n```swift\npublic func searchTransactions(byType type: CDYelpTransactionType!, // Required\n                              location: String?,                    // Optional\n                              latitude: Double?,                    // Optional\n                              longitude: Double?,                   // Optional\n                              completion: @escaping (CDYelpSearchResponse.Transaction?) -\u003e Void)\n```\n\nThe transactions search endpoint has a `type` parameter which allows for query results to be filtered based off one type of criteria. The following lines of code show which transaction types can be passed into the `byType` parameter.\n\n```swift\nCDYelpTransactionType.foodDelivery\n```\n\nThe following lines of code show an example query to the transactions search endpoint.\n\n```swift\nyelpAPIClient.searchTransactions(byType: .foodDelivery,\n                                 location: \"San Francisco\",\n                                 latitude: nil,\n                                 longitude: nil) { (response) in\n\n  if let response = response,\n      let businesses = response.businesses,\n      businesses.count \u003e 0 {\n      print(businesses)\n  }\n}\n```\n\n### [Business Endpoint](https://www.yelp.com/developers/documentation/v3/business)\n\n```swift\npublic func fetchBusiness(forId id: String!,     // Required\n                          locale: CDYelpLocale?, // Optional\n                          completion: @escaping (CDYelpBusinessResponse?) -\u003e Void)\n```\n\nThe following lines of code show an example query to the business endpoint.\n\n```swift\nyelpAPIClient.fetchBusiness(forId: \"north-india-restaurant-san-francisco\"\n                            locale: nil) { (business) in\n\n  if let response = response,\n      let business = response.business {\n      print(business)\n  }\n}\n```\n\n### [Business Match Endpoint](https://www.yelp.com/developers/documentation/v3/business_match)\n\n```swift\npublic func searchBusinesses(name: String!,                                        // Required - Max length = 64\n                             addressOne: String?,                                  // Optional - Max length = 64\n                             addressTwo: String?,                                  // Optional - Max length = 64\n                             addressThree: String?,                                // Optional - Max length = 64\n                             city: String!,                                        // Required - Max length = 64\n                             state: String!,                                       // Required - Max length = 3\n                             country: String!,                                     // Required - Max length = 2\n                             latitude: Double?,                                    // Optional - Min = -90, Max = +90\n                             longitude: Double?,                                   // Optional - Min = -180, Max = +180\n                             phone: String?,                                       // Optional - Max length = 32\n                             zipCode: String?,                                     // Optional\n                             yelpBusinessId: String?,                              // Optional\n                             limit: Int?,                                          // Optional - Min = 1, Default = 3, Max = 10\n                             matchThresholdType: CDYelpBusinessMatchThresholdType, // Required\n                             completion: @escaping (CDYelpSearchResponse.BusinessMatch?) -\u003e Void)\n```\n\nThe business match endpoint has a `matchThresholdType` parameter which allows for query results to be filtered based off three types of criteria. The following lines of code show which business match threshold types can be passed into the `matchThresholdType` parameter.\n\n```swift\nCDYelpBusinessMatchThresholdType.none\nCDYelpBusinessMatchThresholdType.normal\nCDYelpBusinessMatchThresholdType.strict\n```\n\nThe following lines of code show an example query to the business match endpoint.\n\n```swift\nyelpAPIClient.searchBusinesses(name: \"Gary Danko\",\n                               addressOne: \"800 N Point St\",\n                               addressTwo: nil,\n                               addressThree: nil,\n                               city: \"San Francisco\",\n                               state: \"CA\",\n                               country: \"US\",\n                               latitude: nil,\n                               longitude: nil,\n                               phone: nil,\n                               zipCode: nil,\n                               yelpBusinessId: nil,\n                               limit: 5,\n                               matchThresholdType: .normal) { (response) in\n\n  if let response = response,\n      let businesses = response.businesses,\n      businesses.count \u003e 0 {\n      print(businesses)\n  }\n}\n```\n\n### [Reviews Endpoint](https://www.yelp.com/developers/documentation/v3/business_reviews)\n\n```swift\npublic func fetchReviews(forBusinessId id: String!, // Required\n                         locale: CDYelpLocale?,     // Optional\n                         completion: @escaping (CDYelpReviewsResponse?) -\u003e Void)\n```\n\nThe reviews endpoint has a `locale` parameter which allows for query results to be returned based off forty-two types of language and country codes. Refer to the [search endpoint](#search-endpoint) for information regarding using the `locale` parameter.\n\nThe following lines of code show an example query to the reviews endpoint.\n\n```swift\nyelpAPIClient.fetchReviews(forBusinessId: \"north-india-restaurant-san-francisco\",\n                           locale: nil) { (reviews) in\n\n  if let response = response,\n      let reviews = response.reviews,\n      reviews.count \u003e 0 {\n      print(reviews)\n  }\n}\n```\n\n### [Autocomplete Endpoint](https://www.yelp.com/developers/documentation/v3/autocomplete)\n\n```swift\npublic func autocompleteBusinesses(byText text: String!,  // Required\n                                   latitude: Double!,     // Required\n                                   longitude: Double!,    // Required\n                                   locale: CDYelpLocale?, // Optional\n                                   completion: @escaping (CDYelpAutoCompleteResponse?) -\u003e Void)\n```\n\nThe autocomplete endpoint has a `locale` parameter which allows for query results to be returned based off forty-two types of language and country codes. Refer to the [search endpoint](#search-endpoint) for information regarding using the `locale` parameter.\n\nThe following lines of code show an example query to the autocomplete endpoint.\n\n```swift\nyelpAPIClient.autocompleteBusinesses(byText: \"Pizza Delivery\",\n                                     latitude: 37.786572,\n                                     longitude: -122.415192,\n                                     locale: nil) { (response) in\n\n  if let response = response,\n      let businesses = response.businesses,\n      businesses.count \u003e 0 {\n      print(businesses)\n  }\n}\n```\n\n### [Event Lookup Endpoint](https://www.yelp.com/developers/documentation/v3/event)\n\n```swift\npublic func fetchEvent(forId id: String!,     // Required\n                       locale: CDYelpLocale?, // Optional\n                       completion: @escaping (CDYelpEventResponse?) -\u003e Void)\n```\n\nThe event lookup endpoint has a `locale` parameter which allows for query results to be returned based off forty-two types of language and country codes. Refer to the [search endpoint](#search-endpoint) for information regarding using the `locale` parameter.\n\nThe following lines of code show an example query to the event lookup endpoint.\n\n```swift\nyelpAPIClient.fetchEvent(forId: \"san-francisco-yelp-celebrates-pride-month-2021\",\n                         locale: nil) { (event) in\n\n  if let response = response,\n      event = response.event {\n      print(event)\n  }\n}\n```\n\n### [Event Search Endpoint](https://www.yelp.com/developers/documentation/v3/event_search)\n\n```swift\npublic func searchEvents(byLocale locale: CDYelpLocale?,           // Optional\n                         offset: Int?,                             // Optional\n                         limit: Int?,                              // Optional - Default = 3, Max = 50\n                         sortBy: CDYelpEventSortByType?,           // Optional - Default = .descending\n                         sortOn: CDYelpEventSortOnType?,           // Optional - Default = .popularity\n                         startDate: Date?,                         // Optional\n                         endDate: Date?,                           // Optional\n                         categories: [CDYelpEventCategoryFilter]?, // Optional\n                         isFree: Bool?,                            // Optional - Default = false\n                         location: String?,                        // Optional\n                         latitude: Double?,                        // Optional\n                         longitude: Double?,                       // Optional\n                         radius: Int?,                             // Optional - Max = 40000\n                         excludedEvents: [String]?,                // Optional\n                         completion: @escaping (CDYelpEventsResponse?) -\u003e Void)\n```\n\nThe event search endpoint has a `locale` parameter which allows for query results to be returned based off forty-two types of language and country codes. Refer to the [search endpoint](#search-endpoint) for information regarding using the `locale` parameter.\n\nThe event search endpoint has a `sortBy` parameter which allows for query results to be filtered based off two types of criteria. The following lines of code show which sort types can be passed into the `sortBy` parameter.\n\n```swift\nCDYelpEventSortByType.ascending\nCDYelpEventSortByType.descending // Default\n```\n\nThe event search endpoint has a `sortOn` parameter which allows for query results to be filtered based off two types of criteria. The following lines of code show which sort types can be passed into the `sortBy` parameter.\n\n```swift\nCDYelpEventSortOnType.popularity // Default\nCDYelpEventSortOnType.timeStart\n```\n\nThe event search endpoint has a `categories` parameter which allows for query results to be returned based off thirteen types of categories. The following lines of code show which category types can be passed into the `categories` parameter.\n\n```swift\nCDYelpEventCategoryFilter.charities\nCDYelpEventCategoryFilter.fashion\nCDYelpEventCategoryFilter.festivalsAndFairs\nCDYelpEventCategoryFilter.film\nCDYelpEventCategoryFilter.foodAndDrink\nCDYelpEventCategoryFilter.kidsAndFamily\nCDYelpEventCategoryFilter.lecturesAndBooks\nCDYelpEventCategoryFilter.music\nCDYelpEventCategoryFilter.nightlife\nCDYelpEventCategoryFilter.other\nCDYelpEventCategoryFilter.performingArts\nCDYelpEventCategoryFilter.sportsAndActiveLife\nCDYelpEventCategoryFilter.visualArts\n```\n\nThe following lines of code show an example query to the event search endpoint.\n\n```swift\nyelpAPIClient.searchEvents(byLocale: nil,\n                           offset: nil,\n                           limit: 5,\n                           sortBy: .descending,\n                           sortOn: .popularity,\n                           startDate: nil,\n                           endDate: nil,\n                           categories: [.music, .foodAndDrink],\n                           isFree: false,\n                           location: nil,\n                           latitude: 37.786572,\n                           longitude: -122.415192,\n                           radius: 10000,\n                           excludedEvents: nil) { (response) in\n\n  if let response = response,\n      let events = response.events,\n      events.count \u003e 0 {\n      print(events)\n  }\n}\n```\n\n### [Featured Event Endpoint](https://www.yelp.com/developers/documentation/v3/featured_event)\n\n```swift\npublic func fetchFeaturedEvent(forLocale locale: CDYelpLocale?, // Optional\n                               location: String?,               // Optional\n                               latitude: Double?,               // Optional\n                               longitude: Double?,              // Optional\n                               completion: @escaping (CDYelpEventResponse?) -\u003e Void)\n```\n\nThe featured event endpoint has a `locale` parameter which allows for query results to be returned based off forty-two types of language and country codes. Refer to the [search endpoint](#search-endpoint) for information regarding using the `locale` parameter.\n\nThe following lines of code show an example query to the featured event endpoint.\n\n```swift\nyelpAPIClient.fetchFeaturedEvent(forLocale: nil,\n                                 location: nil,\n                                 latitude: 37.786572,\n                                 longitude: -122.415192) { (event) in\n\n  if let response = response,\n      event = response.event {\n      print(event)\n  }\n}\n```\n\n### [All Categories Endpoint](https://www.yelp.com/developers/documentation/v3/all_categories)\n\n```swift\npublic func fetchCategories(forLocale locale: CDYelpLocale?, // Optional\n                            completion: @escaping (CDYelpCategoriesResponse?) -\u003e Void)\n```\n\nThe all categories endpoint has a `locale` parameter which allows for query results to be returned based off forty-two types of language and country codes. Refer to the [search endpoint](#search-endpoint) for information regarding using the `locale` parameter.\n\nThe following lines of code show an example query to the featured event endpoint.\n\n```swift\nyelpAPIClient.fetchCategories(forLocale: nil) { (response) in\n\n  if let response = response,\n      let categories = response.categories {\n    print(categories)\n  }\n}\n```\n\n### [Category Details Endpoint](https://www.yelp.com/developers/documentation/v3/category)\n\n```swift\npublic func fetchCategory(forAlias alias: CDYelpCategoryAlias!, // Required\n                          andLocale locale: CDYelpLocale?,      // Optional\n                          completion: @escaping (CDYelpCategoryResponse?) -\u003e Void)\n```\n\nThe category details endpoint has an `alias` parameter which allows for query results to be returned based off one thousand four hundred and sixty-one types of categories. The full list of categories can be found in `CDYelpEnums.swift`. The following lines of code show an example of a category that can be passed into the `alias` parameter.\n\n```swift\nCDYelpCategoryAlias.activeLife\n```\n\nThe category details endpoint has a `locale` parameter which allows for query results to be returned based off forty-two types of language and country codes. Refer to the [search endpoint](#search-endpoint) for information regarding using the `locale` parameter.\n\nThe following lines of code show an example query to the featured event endpoint.\n\n```swift\nyelpAPIClient.fetchCategory(forAlias: .fastFood,\n                            andLocale: nil) { (response) in\n\n  if let response = response,\n      let category = response.category {\n    print(category)\n  }\n}\n```\n\n### [Deep Linking](https://www.yelp.com/developers/documentation/v2/iphone)\n\nThe Yelp iPhone application registers URL schemes that can be used to open the Yelp application, perform searches, view business information, or check-in.\n\n```swift\nstatic func yelpDeepLink() -\u003e URL?\n```\n\nThe following lines of code show an example of how to check if the Yelp application is installed and then open it.\n\n```swift\nif let url = URL.yelpDeepLink(),\n    UIApplication.shared.canOpenURL(url) {\n    UIApplication.shared.open(url,\n                              options: [:],\n                              completionHandler: nil)\n}\n```\n\n### [Search](https://www.yelp.com/developers/documentation/v2/iphone)\n\n```swift\nstatic func yelpSearchDeepLink(withTerm term: String?,         // Optional\n                               category: CDYelpCategoryAlias?, // Optional\n                               location: String?) -\u003e URL?      // Optional\n```\n\nThe search deep link has a `category` parameter which allows for query results to be returned based off one thousand four hundred and sixty-one types of categories. Refer to the [search endpoint](#search-endpoint) for information regarding using the `category` parameter.\n\nThe following lines of code show an example query to the search deep link.\n\n```swift\nif let url = URL.yelpSearchDeepLink(withTerm: \"burrito\",\n                                    category: .food,\n                                    location: \"San Francisco, CA\"),\n    UIApplication.shared.canOpenURL(url) {\n    UIApplication.shared.open(url,\n                              options: [:],\n                              completionHandler: nil)\n}\n```\n\n### [Business](https://www.yelp.com/developers/documentation/v2/iphone)\n\n```swift\nstatic func yelpBusinessDeepLink(forId id: String!) -\u003e URL? // Required\n```\n\nThe following lines of code show an example query to the business deep link.\n\n```swift\nif let url = URL.yelpBusinessDeepLink(forId: \"the-sentinel-san-francisco\"),\n    UIApplication.shared.canOpenURL(url) {\n    UIApplication.shared.open(url,\n                              options: [:],\n                              completionHandler: nil)\n}\n```\n\n### [Check In Nearby](https://www.yelp.com/developers/documentation/v2/iphone)\n\n```swift\nstatic func yelpCheckInNearbyDeepLink() -\u003e URL?\n```\n\nThe following lines of code show an example query to the check in nearby deep link.\n\n```swift\nif let url = URL.yelpCheckInNearbyDeepLink(),\n    UIApplication.shared.canOpenURL(url) {\n    UIApplication.shared.open(url,\n                              options: [:],\n                              completionHandler: nil)\n}\n```\n\n### [Check-Ins](https://www.yelp.com/developers/documentation/v2/iphone)\n\n```swift\nstatic func yelpCheckInsDeepLink() -\u003e URL?\n```\n\nThe following lines of code show an example query to the check-ins deep link.\n\n```swift\nif let url = URL.yelpCheckInsDeepLink(),\n    UIApplication.shared.canOpenURL(url) {\n    UIApplication.shared.open(url,\n                              options: [:],\n                              completionHandler: nil)\n}\n```\n\n### [Check-In Rankings](https://www.yelp.com/developers/documentation/v2/iphone)\n\n```swift\nstatic func yelpCheckInRankingsDeepLink() -\u003e URL?\n```\n\nThe following lines of code show an example query to the check-in rankings deep link.\n\n```swift\nif let url = URL.yelpCheckInRankingsDeepLink(),\n    UIApplication.shared.canOpenURL(url) {\n    UIApplication.shared.open(url,\n                              options: [:],\n                              completionHandler: nil)\n}\n```\n\n### [Web Linking](https://www.yelp.com/developers/documentation/v2/iphone)\n\nThe Yelp website registers URL schemes that can be used to open the Yelp website, perform searches or view business information.\n\n```swift\nstatic func yelpWebLink() -\u003e URL?\n```\n\nThe following lines of code show an example of how to open the Yelp website.\n\n```swift\nif let url = URL.yelpWebLink(),\n    UIApplication.shared.canOpenURL(url) {\n    UIApplication.shared.open(url,\n                              options: [:],\n                              completionHandler: nil)\n}\n```\n\n### [Search](https://www.yelp.com/developers/documentation/v2/iphone)\n\n```swift\nstatic func yelpSearchWebLink(withTerm term: String?,         // Optional\n                              category: CDYelpCategoryAlias?, // Optional\n                              location: String?) -\u003e URL?      // Optional\n```\n\nThe search deep link has a `category` parameter which allows for query results to be returned based off one thousand four hundred and sixty-one types of categories. Refer to the [search endpoint](#search-endpoint) for information regarding using the `category` parameter.\n\nThe following lines of code show an example query to the search web link.\n\n```swift\nif let url = URL.yelpSearchWebLink(withTerm: \"burrito\",\n                                   category: .food,\n                                   location: \"San Francisco, CA\"),\n    UIApplication.shared.canOpenURL(url) {\n    UIApplication.shared.open(url,\n                              options: [:],\n                              completionHandler: nil)\n}\n```\n\n### [Business](https://www.yelp.com/developers/documentation/v2/iphone)\n\n```swift\nstatic func yelpBusinessWebLink(forId id: String!) -\u003e URL? // Required\n```\n\nThe following lines of code show an example query to the business web link.\n\n```swift\nif let url = URL.yelpBusinessWebLink(forId: \"the-sentinel-san-francisco\"),\n    UIApplication.shared.canOpenURL(url) {\n    UIApplication.shared.open(url,\n                              options: [:],\n                              completionHandler: nil)\n}\n```\n\n### [Brand Assets](https://www.yelp.com/brand)\n\nThe Yelp brand guidelines exist to achieve consistency and make sure the branded elements of Yelp are used correctly across every application.\n\n### [Color](https://www.yelp.com/brand)\n\n```swift\nclass func yelpFiveStarRed() -\u003e UIColor\n```\n\nThe following lines of code show an example of how to use the brand color.\n\n```swift\ncell.textLabel?.textColor = UIColor.yelpFiveStarRed()\n```\n\n### [Logo](https://www.yelp.com/brand)\n\n```swift\nclass func yelpLogo() -\u003e UIImage?\nclass func yelpLogoOutline() -\u003e UIImage?\nclass func yelpBurstLogoRed() -\u003e UIImage?\nclass func yelpBurstLogoWhite() -\u003e UIImage?\n```\n\nThe following lines of code show examples of how to use the brand logo and the brand burst logo.\n\n```swift\ncell.imageView?.image = UIImage.yelpLogo()\ncell.imageView?.image = UIImage.yelpLogoOutline()\ncell.imageView?.image = UIImage.yelpBurstLogoRed()\ncell.imageView?.image = UIImage.yelpBurstLogoWhite()\n```\n\n### [Stars](https://www.yelp.com/developers/display_requirements)\n\n```swift\nclass func yelpStars(numberOfStars: CDYelpStars!,\n                     forSize size: CDYelpStarsSize!) -\u003e UIImage?\n```\n\nThe stars image has a `numberOfStars` parameter which defines the number of filled stars in the returned image. The following lines of code show which number of stars can be passed into the `numberOfStars` parameter.\n\n```swift\nCDYelpStars.zero\nCDYelpStars.one\nCDYelpStars.oneHalf\nCDYelpStars.two\nCDYelpStars.twoHalf\nCDYelpStars.three\nCDYelpStars.threeHalf\nCDYelpStars.four\nCDYelpStars.fourHalf\nCDYelpStars.five\n```\n\nThe stars image has a `forSize` parameter which defines the size of the returned image. The following lines of code show which sizes can be passed into the `forSize` parameter.\n\n```swift\nCDYelpStarsSize.small\nCDYelpStarsSize.regular\nCDYelpStarsSize.large\nCDYelpStarsSize.extraLarge\n```\n\nThe following lines of code show an example of how to use the stars image.\n\n```swift\ncell.imageView?.image = UIImage.yelpStars(numberOfStars: .twoHalf, forSize: .large)\n```\n\n---\n\n## Author\n\nChristopher de Haan, contact@christopherdehaan.me\n\n---\n\n## Resources\n\nVisit the [Yelp Developers](https://www.yelp.com/developers) portal for additional resources regarding the Yelp API.\n\n---\n\n## License\n\nCDYelpFusionKit is available under the MIT license. See the LICENSE file for more info.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisdhaan%2Fcdyelpfusionkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisdhaan%2Fcdyelpfusionkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisdhaan%2Fcdyelpfusionkit/lists"}