There are a few apps. I looked over some and just bought this one and tried it:
https://apps.apple.com/us/app/health-aut...1115567069 called Health Auto Export to CSV.
They also have a desktop version and apparently it supports Automations on the iphone. $1.99.
Screenshot attachment shows the settings I did for a CSV export (that I airdropped to my Mac). It mirrors the data and intervals available on the phone in the health app.
Below is a sample of the CSV.
Date/Time,Min (count/min),Max (count/min),Avg (count/min)
2021-01-21 00:00:28,73,73,73
2021-01-21 00:04:53,72,72,72
2021-01-21 00:09:53,71,71,71
2021-01-21 00:15:08,71,71,71
2021-01-21 00:19:53,72,72,72
2021-01-21 00:24:58,74,74,74
2021-01-21 00:30:03,72,72,72
2021-01-21 00:34:33,69.82,69.82,69.82
2021-01-21 00:36:19,70,70,70
2021-01-21 00:40:22,69,69,69
2021-01-21 00:46:59,70,70,70
2021-01-21 00:50:29,68,68,68
2021-01-21 00:56:14,68,68,68
2021-01-21 01:00:09,70,70,70
2021-01-21 01:05:55,68,68,68
2021-01-21 01:10:29,70,70,70
2021-01-21 01:14:54,71,71,71
2021-01-21 01:20:04,70,70,70
2021-01-21 01:25:29,70,70,70
2021-01-21 01:30:04,69,69,69
2021-01-21 01:35:24,70,70,70
2021-01-21 01:40:29,69,69,69
2021-01-21 01:45:19,67,67,67
2021-01-21 01:50:11,63,63,63
2021-01-21 01:55:14,63,63,63
2021-01-21 02:03:04,66,66,66
2021-01-21 02:05:04,64,64,64
2021-01-21 02:14:19,65,65,65
2021-01-21 02:15:32,66,66,66
2021-01-21 02:21:54,68,68,68
2021-01-21 02:26:33,68,68,68
2021-01-21 02:34:12,69,69,69
2021-01-21 02:34:34,67.67,67.67,67.67
And here is one for Blood Oxygeon Saturation (used my Withings back in July).
Date/Time,Blood Oxygen Saturation (%)
2020-07-09 20:23:45,98