Skip to main content

Search, sort and paging on GET /stocks

GET /stocks can now search, sort and page the catalog through four optional query parameters. Without them the response is unchanged: the whole catalog, in ticker order.

What changed​

  • q: a case-insensitive substring of the ticker, the company name or any venue's token_ticker (apple, TSLA, AAPLx), 1 to 100 characters.
  • sort: market_cap, volume_1d, change_24h, price, pe or ticker. A stock missing the metric sorts last in both directions, and ties break by ticker.
  • order: asc or desc. It defaults to asc for ticker and desc for every metric; sent without sort, it orders by ticker.
  • page: 1-based pages of 25 rows. Only page changes the response: it adds page, next_page (null on the last page) and total (the rows matching q across all pages). Without it, every matching row comes back.

Search, sort and paging run over the same cached snapshot as the plain read.

What to do​

Nothing, unless you want the new parameters. Any other query parameter on /stocks is still 400 invalid_request.