CCRAB Platforms API

Find monitoring platforms, inspect sensors, and request observations.

Download OpenAPI 3.0 schema (JSON)

Getting started

All paths below are relative to this site's origin. Responses use JSON. This reference covers the platforms_app API, including legacy aliases.

  1. For authenticated endpoints, POST your username and password as JSON to /api/token/. Use the returned access token in Authorization: Bearer <access>. POST the refresh token to /api/token/refresh/ to obtain a new access token.
  2. GET /api/platforms/ to discover platform short names, platform handles, and sensor observation names and orders.
  3. Request observations using the exact platform_handle and each sensor's obs_standard_name and s_order. URL-encode query values. Use UTC dates ending in Z, or encode the plus sign in positive timezone offsets as %2B.

Public endpoints require no token. The ingestion configuration endpoint also requires membership in private_api_access. An invalid token can cause a 401 even on public DRF endpoints.

Example observation request

Replace the origin, platform handle and observation pair with values from your platform:

curl --get 'https://YOUR_HOST/api/v1/platform_data_request/' \
  --data-urlencode 'platform_handle=YOUR_PLATFORM_HANDLE' \
  --data-urlencode 'start_date=2026-01-01T00:00:00Z' \
  --data-urlencode 'end_date=2026-01-02T00:00:00Z' \
  --data-urlencode 'observations=YOUR_OBSERVATION_NAME 1'

Endpoints

GET · Bearer token required

List platforms

/api/platforms/

Returns an unpaginated GeoJSON FeatureCollection. Sensors follow the platform's serving policy.

Request parameters
NameLocationRequiredDescription
namequeryNoCase-insensitive partial short_name match. Takes precedence over bbox.
bboxqueryNoBounding box: min_lon,min_lat,max_lon,max_lat. Malformed values are ignored.
Example: -80.1,32.7,-79.8,33.0

Responses

Successful response schema
{
  "$ref": "#/components/schemas/PlatformCollection"
}
GET · Bearer token required

Get a platform

/api/platforms/{short_name}/

Returns the first case-insensitive partial short_name match, optionally constrained by bbox.

Request parameters
NameLocationRequiredDescription
short_namepathYesPlatform short name (partial match).
bboxqueryNoBounding box: min_lon,min_lat,max_lon,max_lat. Malformed values are ignored.
Example: -80.1,32.7,-79.8,33.0

Responses

Successful response schema
{
  "$ref": "#/components/schemas/Platform"
}
GET · Public · Legacy

Legacy public platform list

/api/v1/platforms/

Public alias for the platform collection; prefer the authenticated collection for API integrations.

Request parameters
NameLocationRequiredDescription
namequeryNoCase-insensitive partial short_name match. Takes precedence over bbox.
bboxqueryNoBounding box: min_lon,min_lat,max_lon,max_lat. Malformed values are ignored.
Example: -80.1,32.7,-79.8,33.0

Responses

Successful response schema
{
  "$ref": "#/components/schemas/PlatformCollection"
}
GET · Bearer token required · Legacy

Legacy authenticated platform list

/api/v1/platform_info/

Alias for the authenticated platform collection.

Request parameters
NameLocationRequiredDescription
namequeryNoCase-insensitive partial short_name match. Takes precedence over bbox.
bboxqueryNoBounding box: min_lon,min_lat,max_lon,max_lat. Malformed values are ignored.
Example: -80.1,32.7,-79.8,33.0

Responses

Successful response schema
{
  "$ref": "#/components/schemas/PlatformCollection"
}
GET · Public

Get platform display configuration

/api/v1/platform_configuration/

Includes all sensors and their display flags, including sensors excluded from served observations. Uses the first partial short_name match.

Request parameters
NameLocationRequiredDescription
short_namequeryYesPlatform short name (partial match).
bboxqueryNoBounding box: min_lon,min_lat,max_lon,max_lat. Malformed values are ignored.
Example: -80.1,32.7,-79.8,33.0

Responses

Successful response schema
{
  "$ref": "#/components/schemas/PlatformConfiguration"
}
GET · Bearer token required

Get ingestion source configuration

/api/v1/system/platform_configuration/

Requires a JWT for a user in the private_api_access group. Returns active platforms for the selected active data source, grouped by organization, with observation mappings.

Request parameters
NameLocationRequiredDescription
data_sourcequeryNoData source key. Defaults to purple_air.
Example: purple_air

Responses

Successful response schema
{
  "$ref": "#/components/schemas/SourceConfiguration"
}
GET · Public

Request observations

/api/v1/platform_data_request/

Returns a GeoJSON Feature with JSON timeseries in properties.timeseries. Date bounds are inclusive; start_date must not exceed end_date. Only served observation/order pairs are accepted. No readings returns timeseries: [].

Request parameters
NameLocationRequiredDescription
platform_handlequeryYesExact platform_handle from platform properties.
start_datequeryYesISO 8601 datetime; use an explicit timezone.
Example: 2026-01-01T00:00:00Z
end_datequeryYesISO 8601 datetime; use an explicit timezone.
Example: 2026-01-02T00:00:00Z
observationsqueryYesComma-separated '<obs_standard_name> <s_order>' pairs from the platform's sensors. Duplicate pairs are removed.
Example: pm2_5 1,air_temperature 1

Responses

Successful response schema
{
  "$ref": "#/components/schemas/ObservationFeature"
}

Response models

Model references above resolve to these definitions. Platform responses use GeoJSON: metadata and sensors appear inside properties.

View model definitions
{
  "Error": {
    "type": "object",
    "description": "A detail message or field names mapped to validation error lists.",
    "additionalProperties": true
  },
  "Sensor": {
    "type": "object",
    "properties": {
      "short_name": {
        "type": "string",
        "nullable": true
      },
      "obs_standard_name": {
        "type": "string",
        "nullable": true
      },
      "obs_definition": {
        "type": "string",
        "nullable": true
      },
      "info_url": {
        "type": "string",
        "nullable": true
      },
      "uom_display": {
        "type": "string",
        "nullable": true
      },
      "uom_standard_name": {
        "type": "string",
        "nullable": true
      },
      "uom_definition": {
        "type": "string",
        "nullable": true
      },
      "s_order": {
        "type": "integer",
        "nullable": true
      },
      "active": {
        "type": "integer",
        "nullable": true
      }
    }
  },
  "Geometry": {
    "type": "object",
    "nullable": true,
    "properties": {
      "type": {
        "type": "string",
        "example": "Point"
      },
      "coordinates": {
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    }
  },
  "Platform": {
    "type": "object",
    "properties": {
      "type": {
        "type": "string",
        "enum": [
          "Feature"
        ]
      },
      "geometry": {
        "$ref": "#/components/schemas/Geometry"
      },
      "properties": {
        "type": "object",
        "properties": {
          "sensors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Sensor"
            }
          },
          "begin_date": {
            "type": "string",
            "nullable": true
          },
          "end_date": {
            "type": "string",
            "nullable": true
          },
          "short_name": {
            "type": "string",
            "nullable": true
          },
          "long_name": {
            "type": "string",
            "nullable": true
          },
          "platform_handle": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "neighborhood": {
            "type": "string",
            "nullable": true
          },
          "manufacturer": {
            "type": "string",
            "nullable": true
          },
          "serial_number": {
            "type": "string",
            "nullable": true
          },
          "firmware_version": {
            "type": "string",
            "nullable": true
          },
          "country_name": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string",
            "nullable": true
          },
          "fixed_latitude": {
            "type": "number",
            "nullable": true
          },
          "fixed_longitude": {
            "type": "number",
            "nullable": true
          },
          "active": {
            "type": "integer",
            "nullable": true
          },
          "type_id": {
            "type": "object",
            "nullable": true
          },
          "images": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  },
  "PlatformCollection": {
    "type": "object",
    "properties": {
      "type": {
        "type": "string",
        "enum": [
          "FeatureCollection"
        ]
      },
      "features": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Platform"
        }
      }
    }
  },
  "PlatformConfiguration": {
    "allOf": [
      {
        "$ref": "#/components/schemas/Platform"
      },
      {
        "type": "object",
        "properties": {
          "properties": {
            "type": "object",
            "properties": {
              "sensors": {
                "type": "array",
                "items": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Sensor"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "display": {
                          "type": "boolean"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    ]
  },
  "SourceConfiguration": {
    "type": "object",
    "properties": {
      "organizations": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "org_id": {
              "type": "integer"
            },
            "short_name": {
              "type": "string"
            },
            "long_name": {
              "type": "string"
            },
            "platforms": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/SourcePlatform"
              }
            }
          }
        }
      }
    }
  },
  "ObservationFeature": {
    "type": "object",
    "properties": {
      "type": {
        "type": "string",
        "enum": [
          "Feature"
        ]
      },
      "geometry": {
        "$ref": "#/components/schemas/Geometry"
      },
      "properties": {
        "type": "object",
        "properties": {
          "platform_handle": {
            "type": "string"
          },
          "start_date": {
            "type": "string"
          },
          "end_date": {
            "type": "string"
          },
          "timeseries": {
            "oneOf": [
              {
                "type": "object",
                "description": "JSON timeseries document with header and data."
              },
              {
                "type": "array",
                "maxItems": 0
              }
            ]
          }
        }
      }
    }
  },
  "ObservationMapping": {
    "type": "object",
    "properties": {
      "source_obs": {
        "type": "string",
        "nullable": true
      },
      "source_uom": {
        "type": "string",
        "nullable": true
      },
      "source_identifier": {
        "type": "string",
        "nullable": true
      },
      "target_obs": {
        "type": "string",
        "nullable": true
      },
      "target_uom": {
        "type": "string",
        "nullable": true
      },
      "source_active": {
        "type": "integer",
        "nullable": true
      },
      "target_active": {
        "type": "integer",
        "nullable": true
      },
      "sensor_id": {
        "type": "integer",
        "nullable": true
      },
      "m_type_id": {
        "type": "integer",
        "nullable": true
      },
      "s_order": {
        "type": "integer",
        "nullable": true
      }
    }
  },
  "SourcePlatform": {
    "type": "object",
    "properties": {
      "observations": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ObservationMapping"
        }
      },
      "active": {
        "type": "integer",
        "nullable": true
      },
      "platform_handle": {
        "type": "string",
        "nullable": true
      },
      "short_name": {
        "type": "string",
        "nullable": true
      },
      "external_identifier": {
        "type": "string",
        "nullable": true
      },
      "country_code": {
        "type": "string",
        "nullable": true
      },
      "neighborhood": {
        "type": "string",
        "nullable": true
      },
      "latitude": {
        "type": "number",
        "nullable": true
      },
      "longitude": {
        "type": "number",
        "nullable": true
      }
    }
  }
}