Search code examples
apisocrataopendata

How to query between floating dates?


I am querying from this dataset. From the documentation I know there is a variable disp_date (floating_timestamp). From the documentation I think I should be able to use the between ... and ... on disp_date.

Suppose I want from 2016-01-01 to 2016-02-31. I tried the following:

https://data.brla.gov/resource/4w4d-4es6.json?disp_date between 2016-01-01T00:00:00.000 and 2016-02-01T00:00:00.000

{
  "error" : true,
  "message" : "Unrecognized arguments [disp_date between 2016-01-01T00:00:00.000 and 2016-02-01T00:00:00.000]"
}

Solution

  • It looks like you're missing $where statement at the beginning. Also, need some quotes around the dates. This worked for me:

    https://data.brla.gov/resource/4w4d-4es6.json?$where=disp_date between '2016-01-01T00:00:00.000' and '2016-02-01T00:00:00.000'

    With HTML encoding:

    https://data.brla.gov/resource/4w4d-4es6.json?$where=disp_date%20between%20%272016-01-01T00:00:00.000%27%20and%20%272016-02-01T00:00:00.000%27