Dear colleagues
Due to the large number of bGeigie Nano and CzechRad devices we operate, it is not possible to manually check which device we have data from from the user and which we do not (we lend the devices free of charge, the logistics are handled by someone other than data processing and uploading to the API).
I created the "SAFECAST API checker for Windows":
which is using API search links in JSON and lists the latest uploaded data to the output CSV. Can process hundreds of links in a few minutes but I am facing a following problem.
Example:
- we have CzechRads from 0001 to 1000
- I want to know if there are some data from devices 0003, 0003 and 0005
- I use the API links:
device,device_number,project,comment,api_link
CzechRad,0001,IMPAKT,,
https://api.safecast.org/en-US/bgeigie_imports?by_user_id=6776&format=json&order=created_at+desc&q=0003CzechRad,0002,IMPAKT,,
https://api.safecast.org/en-US/bgeigie_imports?by_user_id=6776&format=json&order=created_at+desc&q=0004CzechRad,0003,IMPAKT,,
https://api.safecast.org/en-US/bgeigie_imports?by_user_id=6776&format=json&order=created_at+desc&q=0005
device,device_number,project,comment,last_data_uploaded,measured_by,data_info,api_link
CzechRad,0003,IMPAKT,,2025-04-04T07:43:12.120Z,Gymta.cz (for SURO.cz),Tábor - walk,
https://api.safecast.org/en-US/bgeigie_imports?by_user_id=6776&format=json&order=created_at+desc&q=0003CzechRad,0004,IMPAKT,,2025-06-17T13:06:56.802Z,Gymta.cz (for SURO.cz),Tábor - walk,
https://api.safecast.org/en-US/bgeigie_imports?by_user_id=6776&format=json&order=created_at+desc&q=0004CzechRad,0005,IMPAKT,,2025-06-17T13:27:35.999Z,Gymta.cz (for SURO.cz),Tábor - walk,
https://api.safecast.org/en-US/bgeigie_imports?by_user_id=6776&format=json&order=created_at+desc&q=0005
Unfortunately, that is wrong because these are all data from device 0500 but the search finds the number "inside" the data filename:
05000330_upload_walk_l.LOG
05000421_upload_walk_l.LOG
05000526_upload_walk_l.LOG
Do you have any idea how to solve this? I was thinking about adding some condition related to 4 left numbers in filename but that makes it complicated... Or just add the filename to the output CSV and add a comment like "device number mismatch" so my colleagues can check it manually...
regards
Jan