lab 4 project for Advanced Computing.
- Emily Chu
- Yiran Ge
Since we are running our API locally we will access the endpoint at http://127.0.0.1:5000 (or the address the appears on your console).
Endpoint
GET /api/records
Example
curl "http://127.0.0.1:5000/api/records"Any query parameter (except limit, offset, format) is treated as a filter.
Examples
curl "http://127.0.0.1:5000/api/records?county=KINGS"
curl "http://127.0.0.1:5000/api/records?bias_motive_description=ANTI-JEWISH"Endpoint
GET /api/records?limit=<int>&offset=<int>
Example
curl "http://127.0.0.1:5000/api/records?limit=108&offset=20"The unique identifier column is full_complaint_id.
Endpoint
GET /api/records/<full_complaint_id>
Example
curl "http://127.0.0.1:5000/api/records/1234567890"Not found (404)
{"error":"Record not found","id":"1234567890"}Endpoints
GET /api/records?format=jsonGET /api/records?format=csv
Examples
curl "http://127.0.0.1:5000/api/records?format=json"
curl "http://127.0.0.1:5000/api/records?format=csv"Combined example
curl "http://127.0.0.1:5000/api/records?county=KINGS&limit=50&offset=0&format=csv"