Skip to main content

Data Sorting

Due to the performance implications of API users trying to sort large datasets (some of which contain tens of millions of records) utilizing the FINRA API platform, the use of the sortFieilds request parameter is restricted.

The use of the sortFields parameter requires that the API request also includes a compareFilter with a compareType of EQUAL on any partition fields associated with the dataset. For example:

1. The weeklySummary dataset contains the weekStartDate and tierIdentifier partition fields. A compareFilter with compareType EQUAL is required for both of these fields when including the sortFields parameter in an API request.

2. The blocksSummary dataset contains the monthStartDate partition field. A compareFilter with compareType EQUAL is required for this field when including the sortFields parameter in an API request.

If the request does not contain the required partition field compare filters, an error response will be returned.

You can use the metadata endpoint to identify the partition fields for each dataset, and the partitions endpoint provides the available values for a partiion field.

NOTES:

  1. If a dataset does not have partition fields (e.g. the Registration API datasets) then a compareFilter for the partition field(s) is not required.
  2. Sorting is not supported on historical datasets (.e.g weeklySummaryHistoric).