Safecast

The Safecast API

Query and add to the Safecast dataset with your own application.

API Endpoint

https://api.safecast.org/en-US

GET https://api.safecast.org/.json

Available Resources

Users
Add and view user accounts
Measurements
Add and view measurements
bGeigie Imports
Add and view bGeigie Imports
Devices
Add and view Devices

Users

Get a list of Safecast users
GET /users.json
Add a new user
POST /users.json
View a user
GET /users/334.json

Measurements

Get a list of Measurements
GET /measurements.json
Add a new measurement
POST /measurements.json
View a measurement
GET /measurements/16989889.json

bGeigie Imports

Get a list of bGeigie Imports
GET /bgeigie_imports.json
Add a new bGeigie Import
POST /bgeigie_imports.json
View a measurement
GET /bgeigie_imports/12377.json

Devices

Get a list of Devices
GET /devices.json
Add a new Device
POST /devices.json
View a device
GET /devices/8.json

Using the API

Measurements

The Measurement is the basic unit in the Safecast database.

A measurement is composed of four key parts.

  • Timestamp captured_at
  • Unit unit
  • Value value
  • Geopoint location (latitude, longitude)

Measurements are accessed via the HTTP API:

GET https://api.safecast.org/measurements.json

Parameters

You can filter the measurements with a variety of options to find measurements near a point, captured on certain dates etc.

Measurements near a point

Provide latitude, longitude and distance.

Example:
GET https://api.safecast.org/measurements.json?distance=10&latitude=34.5&longitude=5.5
Measurements captured before or after certain dates/times.

Provide captured_after, captured_before or both.

Example:
GET https://api.safecast.org/measurements.json?captured_after=2012-09-08+00%3A00&captured_before=2012-09-09+00%3A00
Measurements added to the database before or after certain dates/times.

Provide since, until or both.

Example:
GET https://api.safecast.org/measurements.json?since=2012-09-08+00%3A00&until=2012-09-09+00%3A00

bGeigie Imports

Bulk imports of measurements, typically associated with drives that collect a lot of data using Safecast’s bGeigie devices are processed and logged independently.

You can retrieve a list of all of these imports:

GET https://api.safecast.org/bgeigie_imports.json

And you can view individual imports:

GET https://api.safecast.org/bgeigie_imports/12377.json

Devices

Safecast maintains a list of devices that are used to take radiation measurements. You can view a list of these devices:

GET https://api.safecast.org/devices.json

If you want to add a new device, you can do so:

POST http://api.safecast.dev/en-US/devices.json