#polygon #io #client

polygon_io

Rust Polygon.io client that verifies timestamps are in queried ranges and uses nanoseconds. Converts to EST for equities. Built on ureq and chrono.

25 releases (stable)

4.2.1 Apr 12, 2023
4.2.0 Jan 12, 2023
3.2.2 Jul 20, 2022
2.2.0 Nov 6, 2021
0.0.2 Nov 21, 2020

#77 in Date and time

Download history 12/week @ 2024-02-18 57/week @ 2024-02-25 5/week @ 2024-03-10 1/week @ 2024-03-17 209/week @ 2024-03-31

215 downloads per month

MIT license

49KB
1.5K SLoC

polygon_io

Rust Polygon.io client built on ureq, serde, and ratelimit.

Currently not documented and imports are a little wonky.

Currently only uses REST but websockets support is planned.

Endpoints

Currently Core endpoints and some v2 equities are implemented. PRs for more endpoints are welcome.

core

  • /v2/aggs/ticker/{ticker}/prev
  • /v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from}/{to}
  • /v2/aggs/grouped/locale/{locale}/market/{market}/{date}

reference

  • /v2/reference/tickers
  • /v2/reference/types
  • /v1/meta/symbols/{symbol}/company (waiting on new symbols API)
  • /v1/meta/symbols/{symbol}/news (waiting on new symbols API)
  • /v2/reference/markets
  • /v2/reference/locales
  • /v2/reference/splits/{symbol}
  • /v2/reference/dividends/{symbol}
  • /v2/reference/financials/{symbol}

market status

  • /v1/marketstatus/now
  • /v1/marketstatus/upcoming

equities

  • /v1/meta/exchanges
  • /v2/ticks/stocks/trades/{ticker}/{date}
  • /v2/ticks/stocks/nbbo/{ticker}/{date}
  • /v3/trades/{ticker}
  • /v1/last/stocks/{symbol}
  • /v1/last_quote/stocks/{symbol}
  • /v1/open-close/{symbol}/{date}
  • /v1/meta/conditions/{ticktype}
  • /v2/snapshot/locale/us/markets/stocks/tickers
  • /v2/snapshot/locale/us/markets/stocks/tickers/{ticker}
  • /v2/snapshot/locale/us/markets/stocks/{direction}

forex

  • /v1/historic/forex/{from}/{to}/{date}
  • /v1/conversion/{from}/{to}
  • /v1/last_quote/currencies/{from}/{to}
  • /v2/snapshot/locale/global/markets/forex/tickers
  • /v2/snapshot/locale/global/markets/forex/{direction}

crypto

  • /v1/meta/crypto-exchanges
  • /v1/last/crypto/{from}/{to}
  • /v1/open-close/crypto/{from}/{to}/{date}
  • /v1/historic/crypto/{from}/{to}/{date}
  • /v2/snapshot/locale/global/markets/crypto/tickers
  • /v2/snapshot/locale/global/markets/crypto/tickers/{ticker}
  • /v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book
  • /v2/snapshot/locale/global/markets/crypto/{direction}

Dependencies

~9MB
~178K SLoC