# Availabilities

To fetch the availability of a `Product` (`CatalogItem` or `CatalogItemDetails`) , you may use the following method, passing in the date range you are interested in. If you are only interested in a single day, just pass in the same end date as the start date.

This method will asynchronously return an `Availability` type for every date for which the desired experience is available.

{% tabs %}
{% tab title="iOS" %}

```swift
Traveler.fetchAvailabilities(product: catalogItemDetails, 
                           startDate: Date(), 
                             endDate: Date()) { (availabilities, error) in
  
}
```

Alternatively you can use the delegate pattern

```swift
Traveler.fetchAvailabilities(product: catalogItemDetails, 
                           startDate: Date(), 
                             endDate: Date()),
                            delegate: self)
```

```swift
extension MyViewController: AvailabilitiesFetchDelegate {
    func availabilitiesFetchDidFailWith(_ error: Error) {
    
    }
    
    func availabilitiesFetchDidSucceedWith(_ availabilities: [Availability]) {
    
    }
}
```

{% endtab %}

{% tab title="Android" %}

```java
Traveler.fetchAvailabilities(catalogItem, new Date(), new Date(), new FetchAvailabilitiesCallback() {
    @Override
    void onAvailabilitySuccess(List<Availability> availabilities) {
    
    }
    
    @Overrider
    void onAvailabilityError(Error error) {
    
    }
});
```

{% endtab %}
{% endtabs %}

Embedded inside each `Availability` there may optionally be a `BookingOptionSet` that provide the different `BookingOption`s that may exist for that date. An example of a `BookingOption` may be the different times that are available for that date.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.guestlogix.io/traveler/mobile-sdks/stripe-payment-sdk/availabilities.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
