Cortex returns data empty

I tried using Cortex to fetch the data for the participants but the output is empty. I have also stored the credentials(LAMP_ACCESS_KEY, LAMP_SECRET_KEY, LAMP_SERVER_ADDRESS) in the environment using os.environ method.

import cortex
import time

PARTICIPANT_ID = 'U1606505063'
END_TIME = int(time.time()) 
print(cortex.acc_jerk(id=PARTICIPANT_ID, start=START_TIME, end=END_TIME))

The above code returned the following output.

{'timestamp': 0, 'duration': 1643622864, 'data': [], 'has_raw_data': 0}

Similarly, all the other methods like the significant_locations. sleep_periods, trips also return similar empty data. So I am not sure what is the mistake here. Please help me. Thanks.


Timestamps in LAMP require ms resolution; int(time.time()) returns a timestamp with s resolution. Try converting END_TIME to ms and you should have non-empty data returned.

If empty data is still being returned, please reply in this thread and I will take a closer look.


1 Like


I work with @rohitkatlaa in a team and have tried out the fix you have suggested.

I tried to convert the end time to ms resolution by setting END_TIME = int(time.time()*1e3). In this case, the execution of query is not ending even after long waits. I also tried tweaking the START_TIME by ensuring the total duration was less than a week, yet indefinite execution has been happening.

Could you kindly suggest where we might be going wrong in accessing the data through cortex?


Hi Sama,

Apologies for the late response. I am actively looking into this will respond ASAP when I have suggested fix.