Don't see what you need? Submit a request

Legs endpoint

Jaivin Anzalota -

This endpoint returns a legs collection.

Request

GET /legs

Parameters

Name Required Description
ids Yes Up to 150, comma-delimited leg keys. Extraneous keys are ignored.
include No Comma-delimited list of related resources to include. By default, this endpoint does not return any related resources.
  • score
  • amenity
  • speed
  • seat_summary
  • entertainment_summary
  • power_summary
  • wifi_summary
  • aircraft_summary
  • layout_summary
  • fresh_food_summary
  • segments
  • segments.aircraft
  • segments.entertainment
  • segments.fresh_food
  • segments.layout
  • segments.power
  • segments.seat
  • segments.wifi

Response

Resource Attributes

leg

Name Value set Description
id e.g. BOS-JFK-UA-123-20990224-ECON~JFK-ORD-UA-123-20990224-ECON Leg key

score

Name Value set Description
id 1.0 to 10.0  
word_score Poor
Fair
Okay
Good
Very good
Excellent
1.0 to 4.9
5.0 to 5.9
6.0 to 6.9
7.0 to 7.4
7.5 to 8.4
8.5 to 10.0

amenity

Name Value set Description
id 1 to 5  
descriptor Basic
Satisfactory
Good
Very good
Excellent
1
2
3
4
5

speed

Name Value set Description
id 1 to 5  
descriptor Longest duration
Long duration
Average duration
Short duration
Shortest duration
1
2
3
4
5

aircraft_summary

Name Value set Description
id e.g. "xyz" Unique identifier
display_text e.g. “A320, 777” A string of aircraft families

seat_summary

Name Value set Description
id e.g. "xyz" Unique identifier
display_text e.g. “Mostly above average legroom” A summarization of the seat types on a leg, biased toward the longest segment

layout_summary

Name Value set Description
id e.g. "xyz" Unique identifier
display_text e.g. “Mostly more space (3-3-3) layout” A summarization of the layouts on a leg, biased toward the longest segment

entertainment_summary

Name Value set Description
id e.g. "xyz" Unique identifier
exists no, partial, yes Indicates whether entertainment is available across a leg
display_text Entertainment type display_text, e.g. “On demand entertainment”
Entertainment available
Entertainment mostly available
Entertainment partially available
Entertainment not available
Uniform entertainment across leg
Varying entertainment types across leg
Entertainment available for >=60% of leg
Entertainment available for >0% of leg
Entertainment does not exist on leg

wifi_summary

Name Value set Description
id e.g. "xyz" Unique identifier
exists no, partial, yes Indicates whether Wi-Fi is available across a leg
display_text Wi-Fi type display_text, e.g. “Better Wi-Fi”
Wi-Fi available
Wi-Fi mostly available
Wi-Fi partially available
Wi-Fi not available
Uniform Wi-Fi across leg
Varying Wi-Fi types across leg
Wi-Fi available for >=60% of leg
Wi-Fi available for >0% of leg
Wi-Fi does not exist on leg

power_summary

Name Value set Description
id e.g. "xyz" Unique identifier
exists no, partial, yes Indicates whether power is available across a leg
display_text Power type display_text, e.g. “Power & USB outlets”
Power available
Power mostly available
Power partially available
Power not available
Uniform power across leg
Varying power types across leg
Power available for >=60% of leg
Power available for >0% of leg
Power does not exist on leg

fresh_food_summary

Name Value set Description
id e.g. "xyz" Unique identifier
exists no, partial, yes Indicates whether fresh food is available across a leg
display_text Fresh food type display_text, e.g. “Fresh meal provided”
Fresh food available
Fresh food mostly available
Fresh food partially available
Fresh food not available
Uniform fresh food type across leg
Varying fresh food types across leg
Fresh food available for >=60% of leg
Fresh food available for >0% of leg
Fresh food does not exist on leg

See below for related segment and Flight Amenities for data elements:


Examples

#1 Leg scores

Request

curl \
  -H "Auth: YOUR_API_KEY" \
  -H "Accept: application/vnd.api.v3+json" \
  -G \
  -d ids=DSM-ORD-AA-3558-20160907-FIRST~ORD-SNA-AS-1994-20160907-ECON \
  -d include=score \
  YOUR_HOST/legs

Response

{
  "data": [
    {
      "id": "DSM-ORD-AA-3558-20160907-FIRST~ORD-SNA-AS-1994-20160907-ECON",
      "links": {
        "score": 7.2
      }
    }
  ],
  "linked": {
    "scores": [
      {
        "id": 7.2,
        "word_score": "Good"
      }
    ]
  }
}

#2 Fetching seat and wifi data

Request

curl \
  -H "Auth: YOUR_API_KEY" \
  -H "Accept: application/vnd.api.v3+json" \
  -G \
  -d ids=DSM-ORD-AA-3558-20160907-FIRST~ORD-SNA-AS-1994-20160907-ECON \
  -d include=segments.seat,segments.wifi \
  YOUR_HOST/legs

Response

{
  "data": [
    {
      "id": "DSM-ORD-AA-3558-20160907-FIRST~ORD-SNA-AS-1994-20160907-ECON",
      "links": {
        "segments": [
          "DSM-ORD-AA-3558-20160907-FIRST",
          "ORD-SNA-AS-1994-20160907-ECON"
        ]
      }
    }
  ],
  "linked": {
    "segments": [
      {
        "id": "DSM-ORD-AA-3558-20160907-FIRST",
        "links": {
          "seat": 20,
          "wifi": 2
        }
      },
      {
        "id": "ORD-SNA-AS-1994-20160907-ECON",
        "links": {
          "seat": 3,
          "wifi": 18
        }
      }
    ],
    "seats": [
      {
        "id": 20,
        "display_text": "Recliner seat (37\")",
        "quality": "better",
        "legroom": "more",
        "pitch": "37",
        "width": "n/a",
        "flatness": "not flat",
        "type": "recliner seat",
        "updated_at": "2016-07-01T06:09:52Z"
      },
      {
        "id": 3,
        "display_text": "Standard legroom (31\")",
        "quality": "standard",
        "legroom": "standard",
        "pitch": "31",
        "width": "standard",
        "flatness": "not flat",
        "type": "standard legroom",
        "updated_at": "2016-07-01T06:09:52Z"
      }
    ],
    "wifis": [
      {
        "id": 2,
        "display_text": "Basic Wi-Fi (fee)",
        "quality": "standard",
        "performance": "basic",
        "cost": "paid",
        "exists": "yes",
        "chance": "full",
        "coverage": "full",
        "connectivity_type": "wifi",
        "type": "wifi",
        "updated_at": "2016-05-31T10:03:55Z"
      },
      {
        "id": 18,
        "display_text": "Better Wi-Fi (fee)",
        "quality": "standard",
        "performance": "better",
        "cost": "paid",
        "exists": "yes",
        "chance": "full",
        "coverage": "full",
        "connectivity_type": "wifi",
        "type": "wifi",
        "updated_at": "2016-05-31T10:03:55Z"
      }
    ]
  }
}
Have more questions? Submit a request