import requests
import json


headers = {
    "authority": "booking.jetblue.com",
    "accept": "application/json, text/plain, */*",
    "accept-language": "zh-CN, zh",
    "cache-control": "no-cache",
    "content-type": "application/json",
    "origin": "https://booking.jetblue.com",
    "pragma": "no-cache",
    "referer": "https://booking.jetblue.com/flights/shop/?departureDate=2023-09-30&destination=LAX&flightShopProgress=0&noLCC=false&origin=LAS&stopsOption=ANY_NUMBER&tripCategory=one_way",
    "sec-ch-ua": "\"Chromium\";v=\"116\", \"Not)A;Brand\";v=\"24\", \"Microsoft Edge\";v=\"116\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"macOS\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Edg/116.0.1938.69"
}
cookies = {
    "notice_behavior": "expressed,eu",
    "s_ecid": "MCMID%7C74162417955988611813476470826140175409",
    "AMCVS_A553776A5245AE600A490D44%40AdobeOrg": "1",
    "notice_preferences": "2:",
    "notice_gdpr_prefs": "0,1,2:",
    "cmapi_gtm_bl": "",
    "cmapi_cookie_privacy": "permit 1,2,3",
    "_gcl_au": "1.1.185475204.1694165439",
    "gpv_pn": "JetBlue%20%7C%20Airline%20Tickets%2C%20Flights%20%26%20Airfare%3A%20Book%20Direct%20-%20Official%20Site",
    "recentAirSearch": "JFK",
    "s_cc": "true",
    "_fbp": "fb.1.1694165484169.185475204",
    "_scid": "b409d4a6-9d05-4a88-9d8a-ebb1d5ae90ee",
    "NgbIssueSurvey": "NGB Issue Survey test",
    "_tt_enable_cookie": "1",
    "_ttp": "cHuifNs5hhfZFJu2POZpR_X5DJ2",
    "sPjbpK6x": "A5heyJaKAQAA2rX-U5YOdoDjyUbcq52aIRA_JCJAv7LDLH7C95i0HdzpqAj_AXL3RNgXTuHJwH9eCOfvosJeCA|1|0|6dab84f15bcd816531371ac05b481c9102d2e1dc",
    "_sctr": "1%7C1694707200000",
    "_uetvid": "42d19380537411ee97defdcda5376bcb",
    "notice_poptime": "1693903208580",
    "TAsessionID": "716d3955-cede-4e89-bc52-926af43a99c0|EXISTING",
    "JBC_Flag_20230912": "B",
    "AMCV_A553776A5245AE600A490D44%40AdobeOrg": "2096510701%7CMCIDTS%7C19620%7CMCMID%7C74162417955988611813476470826140175409%7CMCAID%7CNONE%7CMCOPTOUT-1695109492s%7CNONE%7CMCAAMLH-1695707092%7C11%7CMCAAMB-1695707092%7Cj8Odv6LonN4r3an7LhD3WZrU1bUpAkFkkiY1ncBR96t2PTI%7CvVersion%7C2.0.0%7CMCSYNCSOP%7C411-19623",
    "Hopper-Tenant": "jetblue-site",
    "User-Token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJwYXlsb2FkIjoie1wiaG9wcGVyVXNlcklkXCI6XCI2YjA2MjQwMy1lMmU3LTRjNTAtODVjYy0wY2YxYTBlMGE0N2VcIn0iLCJpc3MiOiJob3BwZXItamV0Ymx1ZSIsImV4cCI6MTY5NTEwNTg5M30.MmjaAGW-PCj-EETKxXo_6nmKkbK8OzT4aUy-E2GYrEwL1JMTH3mz_vaHstDn1QPymCaTgKQyatiVsUPBcRiNzg",
    "Analytics RWB Experience": "NGB-Fare-Upsell-Upgrade-Message A",
    "IssueSurvey": "Issue Survey test",
    "_scid_r": "b409d4a6-9d05-4a88-9d8a-ebb1d5ae90ee",
    "fs_lua": "1.1695102622964",
    "fs_uid": "#4HV1Q#de8812d7-a30a-4375-9762-b2c8ecfcb39c:d705a549-f2b0-495d-bbd1-00ab38cac282:1695102281396::3#/1725439208",
    "click_Tracking": "BODY | Search flights + hotel",
    "clickTracking": "BODY%20%7C%20Search%20flights%20%2B%20hotel",
    "s_sq": "jetbluecom2%3D%2526c.%2526a.%2526activitymap.%2526page%253DJetBlue%252520%25257C%252520Home%252520Page%2526link%253DSearch%252520flights%252520%25252B%252520hotel%2526region%253Djb-tabpanel-id-1%2526pageIDType%253D1%2526.activitymap%2526.a%2526.c%2526pid%253DJetBlue%252520%25257C%252520Home%252520Page%2526pidt%253D1%2526oid%253DSearch%252520flights%252520%25252B%252520hotel%2526oidt%253D3%2526ot%253DSUBMIT",
    "ADRUM": "s=1695102711203&r=https%3A%2F%2Fwww.jetblue.com%2F",
    "_dd_s": "logs=1&id=5939da3d-792a-4695-8728-8274138202de&created=1695102293338&expire=1695103638400&rum=1"
}
url = "https://booking.jetblue.com/api/v3/shopSummary"
data = {
    "passengers": {
        "ADT": 1
    },
    "departureDate": "2023-09-30",
    "route": {
        "origin": {
            "regionType": "airport",
            "code": "LAS"
        },
        "destination": {
            "regionType": "airport",
            "code": "LAX"
        }
    },
    "tripFilter": "NoFilter",
    "platform": "Desktop"
}
data = json.dumps(data, separators=(',', ':'))
response = requests.post(url, headers=headers, data=data)

print(response.text)
print(response)