Fetching Data
This example demonstrates how to fetch and aggregate environmental sensor data from the Data Canvas - Sense Your City API using D3, jQuery, and async.js for asynchronous control flow. The visualization retrieves temperature, light, air quality, sound, humidity, and dust readings across multiple cities, then combines the results into CSV format displayed in textareas. It fetches data for the past day, week, month, and 100 days in 5-minute intervals, using the async library’s map and whilst functions to manage API calls while respecting the 1000-row limit. The interface shows live loading indicators and record counters.
AI-generated descriptionThis program fetches data from the Data Canvas - Sense Your City API.
It shows how the API can be accessed using async.js for asynchronous control flow. Data is fetched for each city separately, then combined, then output as CSV.
The API has a limitation of returning at most 1000 rows.