https://github.com/zunda-pixel/tripadvisor-swift
Tripadvisor API Swift Library
https://github.com/zunda-pixel/tripadvisor-swift
swift tripadvisor
Last synced: 3 months ago
JSON representation
Tripadvisor API Swift Library
- Host: GitHub
- URL: https://github.com/zunda-pixel/tripadvisor-swift
- Owner: zunda-pixel
- License: apache-2.0
- Created: 2024-03-01T14:54:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-03T14:35:06.000Z (4 months ago)
- Last Synced: 2025-03-14T12:17:30.235Z (4 months ago)
- Topics: swift, tripadvisor
- Language: Swift
- Homepage:
- Size: 80.1 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tripadvisor Kit
[](https://swiftpackageindex.com/zunda-pixel/tripadvisor-swift)
[](https://swiftpackageindex.com/zunda-pixel/tripadvisor-swift)Tripadvisor Kit for [Tripadivisor API](https://tripadvisor-content-api.readme.io)
## Search Locations
```swift
import TripadvisorKitlet api = TripadvisorAPI(apiKey: "API_KEY")
let query = "Location Name"
let locations = try await api.searchLocations(query: query)
print(locations)
``````shell
[
Location(
id: 13331376,
name: "Apple Park Visitor Center",
description: nil,
webURL: nil,
address: Address(
street1: "10600 N Tantau Ave",
street2: nil,
city: "Cupertino",
state: "California",
country: "United States",
postalCode: "95014-0739",
addressString: "10600 N Tantau Ave, Cupertino, CA 95014-0739"
),
ancestors: nil,,,
),
]
```## Search Near Locations
```swift
let point = Location.Point(latitude: 35.652832, longitude: 139.839478)
let locations = try await api.searchNearLocations(point: point)
```## Get Location Review
```swift
let locationId: Location.ID = "13331376"
let reviews = try await api.locationReviews(id: locationId)
```## Get Loaction Photos
```swift
let locationId: Location.ID = "13331376"
let photos = try await api.locationPhotos(id: locationId)
```## Get Loaction Detail
```swift
let locationId: Location.ID = "13331376"
let location = try await api.locationDetail(id: locationId)
```