Can't target fields in SODA api because of whitespace

288 views Asked by At

I'm trying to use the Socrata SODA API on a NYC gov database by searching for specific street addresses. The URL would look as follows:

http://data.cityofnewyork.us/resource/eabe-havv.json?house_street=PARK+PLACE

However, although I know that PARK PLACE exists in multiple entries in the database, there are no results that appear, and it seems that this is due to a large amount of whitespace following each value:

{
"date_entered": "05/26/1989",
"status": "CLOSED",
"special_district": "   ",
"inspection_date": "09/23/2014",
"unit": "MAN.",
"house_number": "75          ",
"dobrundate": "2014-09-24T00:00:00",
"complaint_category": "05",
"complaint_number": "1002073",
"disposition_code": "L2",
"bin": "1061700",
"house_street": "PARK PLACE               ",
"community_board": "109",
"disposition_date": "09/23/2014"
}

Any tips on how I can access both the house_street value and house_number value through a SoQl query appended to the API url? Thanks!

2

There are 2 answers

0
chrismetcalf On BEST ANSWER

As we talked about on IRC, I've reached out to our account management team about getting this dataset cleaned up. If you're having issues, others are likely having them as well.

Thanks for bringing it to our attention. @Skram's suggestions are good in the meantime.

1
Mark Silverberg On

Due to the aforementioned (see comment) issue and fact that the SODA API does not currently support TRIM or LIKE functions, I think you'll need to use the SoQL full text search as follows:

http://data.cityofnewyork.us/resource/eabe-havv.json?$q=PARK+PLACE

Documentation at http://dev.socrata.com/docs/queries.html