CodeWritingCow / NYC-restaurant-inspection-records

Web application for searching New York City restaurant inspection records
http://www.nycfoodsafety.org
1 stars 3 forks source link

Incorporate Socrata Open Data API #15

Closed CodeWritingCow closed 6 years ago

CodeWritingCow commented 6 years ago

Let's use Socrata functions for querying inspection records by restaurant name or partial search term. The Socrata Open Data API is available for open-government databases maintained by NYC and other governments. Related to Issues #8 and #12

Currently, server.js returns up to 999 records that match query parameters such as borough and zipcode. server.js then filter those results by the name search term.

This process is flawed. The user might be looking for a restaurant that's not among those first 999 records.

The Socrata "like '...'" function solves this problem.

There is a specific endpoint for making queries with Socrata: https://data.cityofnewyork.us/resource/9w7m-hzhe.json

Query strings must be all uppercase. Ex. https://data.cityofnewyork.us/resource/9w7m-hzhe.json?$where=DBA like '%25SUSHI VILLAGE%25'