Back to Smartcitizen.me

Further Documentation on Using Postman Shared Collection

I am attempting to use Postman to connect my data to Power BI for analysis and creating a live dashboard. Unfortunately I am very much a beginner and haven’t been able to get past the first steps. I have imported the shared collection from SC’s API documentation page into Postman but would appreciate a more detailed explanation of how to collect the data from my own sensors.

Using our API to consume data is pretty straightforward.

You don’t need to authenticate. Request a URL using any programming language or tool you like.

You get your device id from the platform URL, i.e. 10234

And then you can get a device, and you will obtain the latest values:

https://api.smartcitizen.me/v0/devices/10753

Check this example in Codepen

You can go forward and get historical readings over some time

https://api.smartcitizen.me/v0/devices/10753/readings?sensor_id=55&rollup=4h&from=2020-02-01&to=2020-03-28

You can also get data from other devices around. Keep in mind that the sensors correspond to all kinds of activities, placements and experiments, and therefore, the data are hardly comparable between devices.

The latest SCK the SCK 2.1 is id: 26.

https://api.smartcitizen.me/v0/kits/26

Therefore, you can filter all devices of this type like this.

https://api.smartcitizen.me/v0/devices/?q[kit_id_eq]=26&per_page=10000

If you only want devices of this type active today in the area of Barcelona (there will be few)

https://api.smartcitizen.me/v0/devices?q[kit_id_eq]=26&q[last_reading_at_gt]=2019-10-28T00:00:00Z&near=41.401108,2.215319

Note that you can filter almost any parameter.

As Python is the defacto tool for data analysis right now, we built our open analysis framework around it. There you’ll find a wrapper for our API

https://github.com/fablabbcn/smartcitizen-iscape-data/blob/master/src/data/api_tools.py

We also compile random examples on the API usage