Querying order book via API

Is there a way to query the order book via the REST API or Web Sockets to get the top x buy/sell orders? Thanks!

There currently isn’t Alpaca or Polygon data for anything but the latest best quotes and not the top x quotes. This “depth” information is referred to as level 2 quotes and isn’t available. Polygon may be offering this soon. They have a note about this in slack. There are also third parties which offer this data. Maybe search the web for some providers.