Write Blood Pressure Data
Stay organized with collections
Save and categorize content based on your preferences.
Your app can record blood pressure data by writing to the com.google.blood_pressure
data type. In this data type, each data point represents a single instantaneous
blood pressure reading. The data point contains fields for the systolic and
diastolic pressure, body position during the reading, and location on the body
where the measurement was performed.
Android
To write a blood pressure data point, create a new DataSource
of TYPE_BLOOD_PRESSURE
,
as shown in the following example.
val bloodPressureSource = DataSource.Builder()
.setDataType(TYPE_BLOOD_PRESSURE)
// ...
.build()
val bloodPressure = DataPoint.builder(bloodPressureSource)
.setTimestamp(timestamp, TimeUnit.MILLISECONDS)
.setField(FIELD_BLOOD_PRESSURE_SYSTOLIC, 120.0f)
.setField(FIELD_BLOOD_PRESSURE_DIASTOLIC, 80.0f)
.setField(FIELD_BODY_POSITION, BODY_POSITION_SITTING)
.setField(
FIELD_BLOOD_PRESSURE_MEASUREMENT_LOCATION,
BLOOD_PRESSURE_MEASUREMENT_LOCATION_LEFT_UPPER_ARM)
.build()
REST
Create a data source
To write a blood pressure data point, create a new data data source
HTTP method
POST
Request URL
https://www.googleapis.com/fitness/v1/users/me/dataSources
Request body
{
"dataStreamName": "BloodPressure",
"type": "raw",
"application": {
"detailsUrl": "http://example.com",
"name": "My Example App",
"version": "1"
},
"dataType": {
"name": "com.google.blood_pressure"
}
}
Response
If your data source was created successfully, you'll get a 200 OK
HTTP
response status code. The response body contains a JSON representation of
the data source, including a datasource.dataStreamId
property. Use this ID
as the dataSourceId
to add data.
Add blood pressure data
Add data by creating a data point of type com.google.blood_pressure
.
HTTP method
PATCH
Request URL
https://www.googleapis.com/fitness/v1/users/me/dataSources/datasource.dataStreamId/datasets/1574159699023000000-1574159699023000000
Request body
For clarity the JSON body shown below is annotated with comments, to show
the use of health field constants.
{
"dataSourceId": "datasource.dataStreamId",
"maxEndTimeNs": 1574159699023000000,
"minStartTimeNs": 1574159699023000000,
"point": [
{
"dataTypeName": "com.google.blood_pressure",
"endTimeNanos": 1574159699023000000,
"startTimeNanos": 1574159699023000000,
"value": [
{
"fpVal": 120.0 // systolic
},
{
"fpVal": 80.0 // diastolic
},
{
"intVal": 2 // Body position enum value for sitting
},
{
"intVal": 3 // Location enum value for left upper arm
}
]
}
]
}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[null,null,["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eGoogle Fit allows recording blood pressure data using the \u003ccode\u003ecom.google.blood_pressure\u003c/code\u003e data type, including systolic and diastolic values, body position, and measurement location.\u003c/p\u003e\n"],["\u003cp\u003eRequired fields for blood pressure data are \u003ccode\u003esystolic\u003c/code\u003e and \u003ccode\u003ediastolic\u003c/code\u003e pressure, measured in mmHg.\u003c/p\u003e\n"],["\u003cp\u003eBody position and measurement location can optionally be specified using predefined enum values.\u003c/p\u003e\n"],["\u003cp\u003eYou can write blood pressure data points on Android using the Google Fit API and on the REST API by creating a data source and adding data points.\u003c/p\u003e\n"]]],[],null,["# Write Blood Pressure Data\n\n| **Note:** Because health data is potentially sensitive, Google Fit [restricts read / write access to health data types](/fit/datatypes/restricted).\n\nYour app can record blood pressure data by writing to the `com.google.blood_pressure`\ndata type. In this data type, each data point represents a single instantaneous\nblood pressure reading. The data point contains fields for the systolic and\ndiastolic pressure, body position during the reading, and location on the body\nwhere the measurement was performed.\n\n- The `systolic` and `diastolic` fields are required, all others are optional.\n- Pressures for `systolic` (upper number) and `diastolic` (lower number) are measured in mmHg.\n- If specified, body position must have one of the following values:\n - `1` - standing up\n - `2` - sitting down\n - `3` - lying down\n - `4` - semi-reclined\n- If specified, measurement location must have one of the following values:\n\n - `1` - left wrist\n - `2` - right wrist\n - `3` - left upper arm\n - `4` - right upper arm\n\n### Android\n\nTo write a blood pressure data point, create a new [`DataSource`](/android/reference/com/google/android/gms/fitness/data/DataSource)\nof [`TYPE_BLOOD_PRESSURE`](/android/reference/com/google/android/gms/fitness/data/HealthDataTypes#TYPE_BLOOD_PRESSURE),\nas shown in the following example. \n\n val bloodPressureSource = DataSource.Builder()\n .setDataType(TYPE_BLOOD_PRESSURE)\n // ...\n .build()\n\n val bloodPressure = DataPoint.builder(bloodPressureSource)\n .setTimestamp(timestamp, TimeUnit.MILLISECONDS)\n .setField(FIELD_BLOOD_PRESSURE_SYSTOLIC, 120.0f)\n .setField(FIELD_BLOOD_PRESSURE_DIASTOLIC, 80.0f)\n .setField(FIELD_BODY_POSITION, BODY_POSITION_SITTING)\n .setField(\n FIELD_BLOOD_PRESSURE_MEASUREMENT_LOCATION,\n BLOOD_PRESSURE_MEASUREMENT_LOCATION_LEFT_UPPER_ARM)\n .build()\n\n### REST\n\nCreate a data source\n--------------------\n\nTo write a blood pressure data point, create a new data data source\n\n**HTTP method** \n\n POST\n\n**Request URL** \n\n```html\nhttps://www.googleapis.com/fitness/v1/users/me/dataSources\n```\n\n**Request body** \n\n {\n \"dataStreamName\": \"BloodPressure\",\n \"type\": \"raw\",\n \"application\": {\n \"detailsUrl\": \"http://example.com\",\n \"name\": \"My Example App\",\n \"version\": \"1\"\n },\n \"dataType\": {\n \"name\": \"com.google.blood_pressure\"\n }\n }\n\n**Response**\n\nIf your data source was created successfully, you'll get a [`200 OK`](https://httpstatuses.com/200) HTTP\nresponse status code. The response body contains a JSON representation of\nthe data source, including a `datasource.dataStreamId` property. Use this ID\nas the `dataSourceId` to add data.\n\nAdd blood pressure data\n-----------------------\n\nAdd data by creating a data point of type `com.google.blood_pressure`.\n\n**HTTP method** \n\n PATCH\n\n**Request URL** \n\n```html\nhttps://www.googleapis.com/fitness/v1/users/me/dataSources/datasource.dataStreamId/datasets/1574159699023000000-1574159699023000000\n```\n\n**Request body**\n\nFor clarity the JSON body shown below is annotated with comments, to show\nthe use of health field constants. \n\n {\n \"dataSourceId\": \"datasource.dataStreamId\",\n \"maxEndTimeNs\": 1574159699023000000,\n \"minStartTimeNs\": 1574159699023000000,\n \"point\": [\n {\n \"dataTypeName\": \"com.google.blood_pressure\",\n \"endTimeNanos\": 1574159699023000000,\n \"startTimeNanos\": 1574159699023000000,\n \"value\": [\n {\n \"fpVal\": 120.0 // systolic\n },\n {\n \"fpVal\": 80.0 // diastolic\n },\n {\n \"intVal\": 2 // Body position enum value for sitting\n },\n {\n \"intVal\": 3 // Location enum value for left upper arm\n }\n ]\n }\n ]\n }"]]