json-apijsonapiframework

JSONAPI filter by date range


GET api how to send the filter parameter if the filter is a date range

eg :

GET /products?filter[created][ge]=2018-01-01&filter[created][le]=2017-01-01

Solution

  • JSON:API specification is agnostic about filter strategy. But, the next way is implemented on various libraries (like ngx-jsonapi or neomerx json-api):

    GET /products?filter[created][since]=2018-01-01&filter[created][until]=2020-01-01