Ejemplo de Acceso a BigData

#This example gets data from Bigdata MobilityLabs collection using the API REST FULL DataProvider. Data is getting from PM 2.5 Madrid Opendata Layer. Using the filter “query” the data recovered contains only the idStation 28079038 and sensor values greater than 25

import httplib
url=”https://rbdata.emtmadrid.es::8443/DataProvider/api/dmz/getCollection/yourUser/yourPasskey/Layers/SENPM25MAD.eventpos/”
query= { “idStation”: “28079038”, “$and”: [ { “value”: { “$gt”: “00025” } } ] }

headers = {
‘content-type’: “application/json”,
‘cache-control’: “no-cache”
}
headers = {
‘content-type’: “application/json”,
‘cache-control’: “no-cache”
}
response = requests.request(“POST”, url, data=query, headers=headers)

print(response.text)