import requests
from amadeus import Client, ResponseError
amadeus = Client(
client_id='YOUR_API_KEY',
client_secret='YOUR_API_SECRET'
)
try:
response = amadeus.reference_data.urls.get()
print(response.data)
except ResponseError as error:
print(error)
import requests
from amadeus import Client, ResponseError
amadeus = Client(
client_id='YOUR_API_KEY',
client_secret='YOUR_API_SECRET'
)
try:
response = amadeus.shopping.flight_offers.get(
origin='NYC',
destination='MAD',
departureDate='2022-12-01',
adults=1)
print(response.data)
except ResponseError as error:
print(error)
请确保您的查询参数使用正确的格式,并且您已将所有必需的参数包含在请求中。如果您不确定哪些参数是必需的,可以参考Amadeus API文档。