Assistance with Safecast API 503 Errors, Device IDs, and Bulk Data Access

30 views
Skip to first unread message

Mariia Tsymberh

unread,
Apr 17, 2025, 1:49:08 AMApr 17
to Safecast Device Discussions and Support
Hi ! I’m developing a non-commercial radiation mapping project using the Safecast API to fetch measurements and display them on a heatmap via Firestore. My script queries `/measurements.json?since=...&per_page=1000` every 2 hours through GitHub Actions but consistently encounters 503 Service Unavailable errors (“Back-end server is at capacity”), even with retries (5-40s delays). I’ve reduced `per_page` to 100 and added pagination, but the issue persists.

Additionally, I’m facing challenges with `device_info` mapping. The `/measurements.json` endpoint returns high-numbered `device_id`s (e.g., 100412, 65006), but `/devices` and `/devices/{device_id}.json` return unrelated IDs (e.g., 4-28) or no data, leaving `device_info` empty. I understand from your web map data flow documentation that bGeigies may have NULL `device_id`s, which could explain mismatches.

Could you assist with:
1. Are 503 errors due to free-tier rate limits or server capacity? Would smaller `per_page` (e.g., 50) or specific request timing help?
2. Why do `device_id`s from `/measurements.json` not match `/devices`? Is there a correct endpoint or table for these IDs?
3. Your documentation mentions a filtered dataset and SQLite database for download. Can you provide the URLs for these bulk exports (CSV/JSON or SQLite)?
4. Is a higher-limit API key available for non-commercial projects to improve reliability?

 Any guidance would be greatly appreciated.

Thank you,
Mariia Tsymberh 

Rob Oudendijk

unread,
Apr 17, 2025, 11:43:12 PMApr 17
to Safecast Device Discussions and Support

Mariia,


The API is running on a small instance of AWS and has often timeouts.
For the rt.safecast.org (running custom WordPress setup)we do pull also from the API and that typically timeouts too. But it works.

As far as I know, all devices have device_id.
Did you check https://github.com/Safecast/safecastapi/wiki/Data-Sets? The Kibana and SNS do not work at the moment (long story)

Interesting project. Do you have a GitHub repo of the project?

Warm Regards
Rob Oudendijk

Rob Oudendijk

unread,
Apr 18, 2025, 12:14:05 AMApr 18
to Safecast Device Discussions and Support
Mariia,

Currently, we are also working on a new heatmap of Safecast data. See https://github.com/Safecast/map2025
Maybe we can work together?

Hugs and peace,
Rob

Mariia Tsymberh

unread,
May 16, 2025, 6:54:05 AMMay 16
to Safecast Device Discussions and Support


Dear Rob,

I’m sorry for the delayed response; I’ve been tied up with project tweaks. Thank you for your insights about the API on AWS and the Data Sets wiki. My heatmap project is progressing, storing data in Firestore via a GitHub Actions workflow. I’ve hit a few issues:
1. Some measurements have invalid `unit` values, like "211" instead of "uSv/h". Is this an API data error or specific to certain devices?
2. I see `NULL` device_ids (e.g., measurement 265802150) and unmatched device_ids (e.g., 100401, 100412, 65006) returning 404s or 503s. Are these expected, or is there a device list to validate against?

Your heatmap looks exciting! I’ll check out the GitHub repo.

Thank you, and apologies again for the delay,
Mariia Tsymberh
Reply all
Reply to author
Forward
0 new messages