---
title: addFlightSearch
slug: js-api/addflightsearch
description: Overview of the Monetate Travel API's addFlightSearch method and how to use it
image:  https://archbee-image-uploads.s3.amazonaws.com/ceIfEvQHzQk1IVxoRWUh7/K9eTL4jKm7UQINb6zNziJ-20250912-181225.png
docTags: 
createdAt: 2024-04-30T20:22:14.041Z
---

:::hint{type="warning"}
This method call is only available to clients using the [Monetate Travel API](docId\:vhdqXHIQl8l4Mfz6YjkVB).
:::

:::CodeblockTabs
addFlightSearch Method

```javascript
// addFlightSearch Method
window.monetateQ = window.monetateQ || [];
window.monetateQ.push(['addFlightSearch', {
  // Required
  'depDate': ['20260315'], // March 15, 2026
  'destination': ['CDG'],
  'origin': ['LHR'],
  'travelers': [5],
  // Optional
  'adults': [2],
  'infants': [1],
  'minors': [1],
  'seniors': [1],
  'retDate': ['20260421'], // April 21, 2026
  'serviceClass': ['Standard', 'First']
}]);
window.monetateQ.push(['trackData']);
```
:::

The `addFlightSearch` method passes information from your site to Monetate when a user searches for a flight. This method consists of four required attributes and six optional attributes.

## Required Attributes

These attributes are required with the `addFlightSearch` method:

- `depDate` — A string that includes the flight's departure date in YYYYMMDD format
- `destination` — A string that includes the flight's destination (airport or city)
- `origin` — A string that includes the flight's point of origin (airport or city)
- `travelers` — An integer that includes the number of travelers on a flight

## Optional Attributes

These attributes are optional for the `addFlightSearch` method:

- `adults` — An integer that includes the total number of adults booking a flight
- `infants` — An integer that includes the total number of infants booking a flight
- `minors` — An integer that includes the total number of minors booking a flight
- `seniors` — An integer that includes the total number of seniors booking a flight
- `retDate` — A string that includes the flight's return date in YYYYMMDD format; not used for multiple flights
- `serviceClass` — A string that includes the service class for the seats on a flight searched (business, economy, first, etc.)

