Skip to main content

PyPI Python versions Pre-commit Tests Docs

A simple Python API to interact with Dexcom Share service. Used to get real-time Dexcom CGM sensor data.

Quick-start

  1. Download the Dexcom G7 / G6 / G5 / G4 mobile app and enable the Share service.

The Dexcom Share service requires setup of at least one follower to enable the share service, but pydexcom will use your (or the dependent's) credentials, not the follower's or manager's.

  1. Install the pydexcom package.

pip install pydexcom

  1. Profit.
>>> from pydexcom import Dexcom
>>> dexcom = Dexcom(username="username", password="password") # `region="ous"` if outside of US, `region="jp"` if Japan
>>> dexcom = Dexcom(username="+11234567890", password="password") # phone number
>>> dexcom = Dexcom(username="user@email.com", password="password") # email address
>>> dexcom = Dexcom(account_id="12345678-90ab-cdef-1234-567890abcdef", password="password") # account ID (advanced)
>>> glucose_reading = dexcom.get_current_glucose_reading()
>>> print(glucose_reading)
85

>>> glucose_reading.value
85

>>> glucose_reading.mmol_l
4.7

>>> glucose_reading.trend
4

>>> glucose_reading.trend_direction
'Flat'

>>> glucose_reading.trend_description
'steady'

>>> glucose_reading.trend_arrow
'→'

>>> print(bg.datetime)
2023-08-07 20:40:58

>>> glucose_reading.json
{'WT': 'Date(1691455258000)', 'ST': 'Date(1691455258000)', 'DT': 'Date(1691455258000-0400)', 'Value': 85, 'Trend': 'Flat'}

Documentation

https://gagebenne.github.io/pydexcom/pydexcom.html

Frequently Asked Questions

Why is my password not working?

The Dexcom Share API understandably reports limited information during account validation. If anything is incorrect, the API simply reports back invalid password ( pydexcom.errors.AccountErrorEnum ). However, there could be many reasons you are getting this error:

1. Ensure your credentials are valid.

Validate your Dexcom account credentials by logging on to the Dexcom Account Management website for your region:

For users in the United States: uam1.dexcom.com. For users outside of the United States: uam2.dexcom.com. For users in the Asia-Pacific: uam.dexcom.jp.

2. Use the correct Dexcom Share API endpoint.

For users in the United States: use the default, or set region="us" when initializing Dexcom. For users outside of the United States: be sure to set region="ous" when initializing Dexcom . For users in Japan: be sure to set region="jp" when initializing Dexcom.

3. Ensure your username is correctly formatted.

Format phone numbers with a +, your country code, then your phone number. For example, a US phone number of (123)-456-7890 would be supplied as a username="+11234567890".

4. Use your Dexcom Share credentials, not the follower's credentials.

Use the same credentials used to login to the Dexcom mobile application publishing the glucose readings.

5. Ensure you have at least one follower on Dexcom Share.

The Dexcom Share service requires setup of at least one follower to enable the service, as does this package.

6. Try using your account ID.

You can find your account ID by logging in to Dexcom Account Management website for your region. After logging in, note the UUID in the URL -- this is your account ID.

Format account IDs (UUIDs) with hyphens. For example, an account ID of 1234567890abcdef1234567890abcdef found in the URL after logging in would be supplied as account_id="12345678-90ab-cdef-1234-567890abcdef".

7. Report it!

The Dexcom Share API sometimes changes. If you believe there is an issue with pydexcom , feel free to create an issue if one has not been created yet already.

Why not use the official Dexcom Developer API?

The official Dexcom API is a great tool to view trends, statistics, and day-by-day data, but is not suitable for real time fetching of glucose readings as it is a retrospective API.

Can I use the Dexcom Stelo with this package?

No, the Dexcom Stelo isn't compatible with the Dexcom Share service, so this package can't retrieve its readings.

How can I let you know of suggestions or issues?

By all means submit a pull request if you have a feature you would like to see in the next release. Alternatively, you may create an issue if you have a suggestion or bug you'd like to report.

Where is this package being used?

Primarily this package is used in the Home Assistant Dexcom integration, but it's fantastic to see community projects involving pydexcom :

Release files for pydexcom 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydexcom 0.5.1
File Size Uploaded
pydexcom-0.5.1.tar.gz 22.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydexcom 0.5.1
File Interpreter ABI Platform
pydexcom-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 33.2 kB

Release files / pydexcom-0.5.1.tar.gz

Download URL pydexcom-0.5.1.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1789408929547d8cb48a53369cc0f1b25f0377e5770e9eb2f4e7c249d8325d2e
BLAKE2b-256 checksum
How to use checksums
7510f1682348db56733d8bd85c5582dd6ad37c4612cb4d36c9b24e5c109e3e3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 25, 2026.

Transparency log

Release files / pydexcom-0.5.1-py3-none-any.whl

Download URL pydexcom-0.5.1-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf009d9360c8c3c64c73c07d55a9e30831f2094fd9a243535cde78f8cfa549cb
BLAKE2b-256 checksum
How to use checksums
28ba38ccac326421383ab3cec4c2f61005fc123093c99f2460ed8c98f023ab1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page