> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.id.me/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.id.me/_mcp/server.

# Python

> Learn more about integrating using Python

Version 1.0

Released March 25, 2022

\
\


View changelog

View on Github

This is a sample seed Python Web App integrated with ID.me via OAuth 2.0

> **Note**
>
> You will need an [ID.me developer account](https://api.id.me/en/registration/new) to complete this process

## Prerequisites

In order to run the example, you must have `python` and `pip` installed

## Installation

Download the [code](https://github.com/IDme/python-sample-code)

Set your client configuration settings in `server.py` with the values provided in your [developer account](https://api.id.me/en/session/new)

```python
# server.py
client_id              = 'YOUR_CLIENT_ID'
client_secret          = 'YOUR_CLIENT_SECRET'
redirect_uri           = 'YOUR_REDIRECT_URI'
authorization_base_url = 'https://api.id.me/oauth/authorize'
token_url              = 'https://api.id.me/oauth/token'
attributes_url         = 'https://api.id.me/api/public/v3/attributes.json'

# possible scope values: "military", "student", "responder", "government", "teacher"
scope = ['YOUR_SCOPE_VALUE']
```

Run the following to install the dependencies and start the server:

```bash
pip install -r requirements.txt
python server.py
```

View the app at [http://localhost:5000](http://localhost:5000)