client-python icon indicating copy to clipboard operation
client-python copied to clipboard

enable async calls

Open jingyi-zhao-01 opened this issue 5 months ago • 1 comments

Is your feature request related to a problem? Please describe. https://polygon.io/docs/rest/options/snapshots/option-contract-snapshot

  • client.get_snapshot_option is sync,cannot leverage coroutine for multiple asynchrounus fetching.
  • it's very slow when fetching each one by one.

Describe the solution you'd like

  • Enable async call of this funtion version so people cacn leverage ccouroutine.
tasks = [
        client.get_contract_snapshot_async(underlying_asset, contract.ticker)
        for contract in contracts
    ]

    return await asyncio.gather(*tasks)

jingyi-zhao-01 avatar Jul 26 '25 11:07 jingyi-zhao-01

Could also do it like OpenAI where there is just a whole separate client, where everything is async.

Keeps the existing API unchanged, and people probably don't want to do both sync and async at the same time

charlielidbury avatar Nov 13 '25 02:11 charlielidbury