You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Amadeus兴趣点API的page[limit]参数Python调用名称咨询

Amadeus兴趣点API分页参数的正确写法

在Amadeus Python SDK中,针对API文档里的page[limit]参数,有两种正确的传递方式:

  • 方式一:使用字典参数
    直接传递名为page的字典,将limit作为字典的键传入:

    from amadeus import Client, ResponseError
    
    amadeus = Client(
        client_id='<my_client_id>',
        client_secret='<my_client_secret>'
    )
    
    response = amadeus.reference_data.locations.points_of_interest.by_square.get(
        north=41.42,
        west=2.11,
        south=41.347463,
        east=2.228208,
        categories=['SIGHTS','NIGHTLIFE'],
        page={'limit': 5}
    )
    
  • 方式二:使用下划线拼接的参数名
    如果你的SDK版本是较新的,也可以直接用page_limit作为参数名,SDK会自动将其转换为API要求的page[limit]格式:

    response = amadeus.reference_data.locations.points_of_interest.by_square.get(
        north=41.42,
        west=2.11,
        south=41.347463,
        east=2.228208,
        categories=['SIGHTS','NIGHTLIFE'],
        page_limit=5
    )
    

    若之前使用page_limit被忽略,建议检查并更新Amadeus SDK到最新版本。

内容的提问来源于stack exchange,提问作者Juan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.30 02:05:03