API#
- class minim.tidal.API(*, client_id: str = None, client_secret: str = None, flow: str = 'client_credentials', access_token: str = None, expiry: datetime | str = None, overwrite: bool = False, save: bool = True)[source]#
Bases:
object
TIDAL API client.
The TIDAL API exposes TIDAL functionality and data, making it possible to build applications that can search for and retrieve metadata from the TIDAL catalog.
See also
For more information, see the TIDAL API Reference.
Requests to the TIDAL API endpoints must be accompanied by a valid access token in the header. Minim can obtain client-only access tokens via the client credentials flow, which requires valid client credentials (client ID and client secret) to either be provided to this class’s constructor as keyword arguments or be stored as
TIDAL_CLIENT_ID
andTIDAL_CLIENT_SECRET
in the operating system’s environment variables.See also
To get client credentials, see the guide on how to register a new TIDAL application.
If an existing access token is available, it and its expiry time can be provided to this class’s constructor as keyword arguments to bypass the access token retrieval process. It is recommended that all other authorization-related keyword arguments be specified so that a new access token can be obtained when the existing one expires.
Tip
The authorization flow and access token can be changed or updated at any time using
set_auflow()
andset_access_token()
, respectively.Minim also stores and manages access tokens and their properties. When an access token is acquired, it is automatically saved to the Minim configuration file to be loaded on the next instantiation of this class. This behavior can be disabled if there are any security concerns, like if the computer being used is a shared device.
- Parameters:
- client_idstr, keyword-only, optional
Client ID. Required for the client credentials flow. If it is not stored as
TIDAL_CLIENT_ID
in the operating system’s environment variables or found in the Minim configuration file, it must be provided here.- client_secretstr, keyword-only, optional
Client secret. Required for the client credentials flow. If it is not stored as
TIDAL_CLIENT_SECRET
in the operating system’s environment variables or found in the Minim configuration file, it must be provided here.- flowstr, keyword-only, optional
Authorization flow.
Valid values:
"client_credentials"
for the client credentials flow.
- access_tokenstr, keyword-only, optional
Access token. If provided here or found in the Minim configuration file, the authorization process is bypassed. In the former case, all other relevant keyword arguments should be specified to automatically refresh the access token when it expires.
- expirydatetime.datetime or str, keyword-only, optional
Expiry time of access_token in the ISO 8601 format
%Y-%m-%dT%H:%M:%SZ
. If provided, the user will be reauthenticated using the specified authorization flow (if possible) when access_token expires.- overwritebool, keyword-only, default:
False
Determines whether to overwrite an existing access token in the Minim configuration file.
- savebool, keyword-only, default:
True
Determines whether newly obtained access tokens and their associated properties are stored to the Minim configuration file.
- Attributes:
- sessionrequests.Session
Session used to send requests to the TIDAL API.
- API_URLstr
Base URL for the TIDAL API.
- TOKEN_URLstr
URL for the TIDAL API token endpoint.
Methods
Album API > Get single album: Retrieve album details by TIDAL album ID.
Album API > Get album by barcode ID: Retrieve a list of album details by barcode ID.
Album API > Get album items: Retrieve a list of album items (tracks and videos) by TIDAL album ID.
Album API > Get multiple albums: Retrieve a list of album details by TIDAL album IDs.
Artist API > Get single artist: Retrieve artist details by TIDAL artist ID.
Artist API > Get albums by artist: Retrieve a list of albums by TIDAL artist ID.
Track API > Get tracks by artist: Retrieve a list of tracks made by the specified artist.
Artist API > Get multiple artists: Retrieve a list of artist details by TIDAL artist IDs.
Album API > Get similar albums for the given album: Retrieve a list of albums similar to the given album.
Artist API > Get similar artists for the given artist: Retrieve a list of artists similar to the given artist.
Track API > Get similar tracks for the given track: Retrieve a list of tracks similar to the given track.
Track API > Get single track: Retrieve track details by TIDAL track ID.
Album API > Get multiple tracks: Retrieve a list of track details by TIDAL track IDs.
Track API > Get tracks by ISRC: Retrieve a list of track details by ISRC.
Video API > Get single video: Retrieve video details by TIDAL video ID.
Album API > Get multiple videos: Retrieve a list of video details by TIDAL video IDs.
Search API > Search for catalog items: Search for albums, artists, tracks, and videos.
Set the TIDAL API access token.
Set the authorization flow.
- get_album(album_id: int | str, country_code: str) dict[str, Any] [source]#
Album API > Get single album: Retrieve album details by TIDAL album ID.
- Parameters:
- album_idint or str
TIDAL album ID.
Example:
251380836
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.
- Returns:
- albumdict
TIDAL catalog information for a single album.
Sample response
{ "id": <str>, "barcodeId": <str>, "title": <str>, "artists": [ { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ], "main": <bool> } ], "duration": <int>, "releaseDate": <str>, "imageCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "videoCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "numberOfVolumes": <int>, "numberOfTracks": <int>, "numberOfVideos": <int>, "type": "ALBUM", "copyright": <str>, "mediaMetadata": { "tags": [<str>] }, "properties": { "content": [<str>] } }
- get_album_by_barcode_id(barcode_id: int | str, country_code: str) dict[str, Any] [source]#
Album API > Get album by barcode ID: Retrieve a list of album details by barcode ID.
- Parameters:
- barcode_idint or str
Barcode ID in EAN-13 or UPC-A format.
Example:
196589525444
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.
- Returns:
- albumdict
TIDAL catalog information for a single album.
Sample response
{ "data": [ { "resource": { "id": <str>, "barcodeId": <str>, "title": <str>, "artists": [ { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ], "main": <bool> } ], "duration": <int>, "releaseDate": <str>, "imageCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "videoCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "numberOfVolumes": <int>, "numberOfTracks": <int>, "numberOfVideos": <int>, "type": "ALBUM", "copyright": <str>, "mediaMetadata": { "tags": [<str>] }, "properties": { "content": [<str>] } }, "id": <str>, "status": 200, "message": "success" } ], "metadata": { "requested": 1, "success": 1, "failure": 0 } }
- get_album_items(album_id: int | str, country_code: str, *, limit: int = None, offset: int = None) dict[str, Any] [source]#
Album API > Get album items: Retrieve a list of album items (tracks and videos) by TIDAL album ID.
- Parameters:
- album_idint or str
TIDAL album ID.
Examples:
251380836
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.- limitint, keyword-only, optional
Page size.
Example:
10
.- offsetint, keyword-only, optional
Pagination offset (in number of items).
Example:
0
.
- Returns:
- itemsdict
A dictionary containing TIDAL catalog information for tracks and videos in the specified album and metadata for the returned results.
Sample response
{ "data": [ { "resource": { "artifactType": <str>, "id": <str>, "title": str>, "artists": [ { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ], "main": <bool> } ], "album": { "id": <str>, "title": <str>, "imageCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "videoCover": [] }, "duration": <int>, "trackNumber": <int>, "volumeNumber": <int>, "isrc": <str>, "copyright": <str>, "mediaMetadata": { "tags": [<str>] }, "properties": { "content": [<str>] } }, "id": <str>, "status": 200, "message": "success" } ], "metadata": { "total": <int> } }
- get_albums(album_ids: int | str | list[int | str], country_code: str) list[dict[str, Any]] [source]#
Album API > Get multiple albums: Retrieve a list of album details by TIDAL album IDs.
- Parameters:
- album_idsint, str, or list
TIDAL album ID(s).
Examples:
"251380836,275646830"
or[251380836, 275646830]
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.
- Returns:
- albumsdict
A dictionary containing TIDAL catalog information for multiple albums and metadata for the returned results.
Sample response
{ "data": [ { "resource": { "id": <str>, "barcodeId": <str>, "title": <str>, "artists": [ { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ], "main": <bool> } ], "duration": <int>, "releaseDate": <str>, "imageCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "videoCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "numberOfVolumes": <int>, "numberOfTracks": <int>, "numberOfVideos": <int>, "type": "ALBUM", "copyright": <str>, "mediaMetadata": { "tags": [<str>] }, "properties": { "content": [<str>] } }, "id": <str>, "status": 200, "message": "success" } ], "metadata": { "requested": <int>, "success": <int>, "failure": <int> } }
- get_artist(artist_id: int | str, country_code: str) dict[str, Any] [source]#
Artist API > Get single artist: Retrieve artist details by TIDAL artist ID.
- Parameters:
- artist_idint or str
TIDAL artist ID.
Example:
1566
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.
- Returns:
- artistdict
TIDAL catalog information for a single artist.
Sample response
{ "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ] }
- get_artist_albums(artist_id: int | str, country_code: str, *, limit: int = None, offset: int = None) dict[str, Any] [source]#
Artist API > Get albums by artist: Retrieve a list of albums by TIDAL artist ID.
- Parameters:
- artist_idint or str
TIDAL artist ID.
Example:
1566
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.- limitint, keyword-only, optional
Page size.
Example:
10
.- offsetint, keyword-only, optional
Pagination offset (in number of items).
Example:
0
.
- Returns:
- albumsdict
A dictionary containing TIDAL catalog information for albums by the specified artist and metadata for the returned results.
Sample response
{ "data": [ { "resource": { "id": <str>, "barcodeId": <str>, "title": <str>, "artists": [ { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ], "main": <bool> } ], "duration": <int>, "releaseDate": <str>, "imageCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "videoCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "numberOfVolumes": <int>, "numberOfTracks": <int>, "numberOfVideos": <int>, "type": "ALBUM", "copyright": <str>, "mediaMetadata": { "tags": <str> }, "properties": { "content": <str> } }, "id": <str>, "status": 200, "message": "success" } ], "metadata": { "total": <int> } }
- get_artist_tracks(artist_id: int | str, country_code: str, limit: int = None, offset: int = None) dict[str, Any] [source]#
Track API > Get tracks by artist: Retrieve a list of tracks made by the specified artist.
- Parameters:
- artist_idint or str
TIDAL artist ID.
Example:
1566
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.- limitint, keyword-only, optional
Page size.
Example:
10
.- offsetint, keyword-only, optional
Pagination offset (in number of items).
Example:
0
.
- Returns:
- tracksdict
A dictionary containing TIDAL catalog information for tracks by the specified artist and metadata for the returned results.
Sample response
{ "data": [ { "resource": { "properties": { "content": <str> }, "id": <str>, "version": <str>, "duration": <int>, "album": { "id": <str>, "title": <str>, "imageCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "videoCover": [ { "url": <str>, "width": <int>, "height": <int> } ] }, "title": <str>, "copyright": <str>, "artists": [ { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ], "main": <bool> } ], "popularity": <float>, "isrc": <str>, "trackNumber": <int>, "volumeNumber": <int>, "tidalUrl": <str>, "providerInfo": { "providerId": <str>, "providerName": <str> }, "artifactType": <str>, "mediaMetadata": { "tags": <str> } }, "id": <str>, "status": <int>, "message": <str> } ], "metadata": { "total": <int> } }
- get_artists(artist_ids: int | str | list[int | str], country_code: str) dict[str, Any] [source]#
Artist API > Get multiple artists: Retrieve a list of artist details by TIDAL artist IDs.
- Parameters:
- artist_idsint, str, or list
TIDAL artist ID(s).
Examples:
"1566,7804"
or[1566, 7804]
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.
- Returns:
- artistsdict
A dictionary containing TIDAL catalog information for multiple artists and metadata for the returned results.
Sample response
{ "data": [ { "resource": { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ] }, "id": <str>, "status": 200, "message": "success" } ], "metadata": { "requested": <int>, "success": <int>, "failure": <int> } }
- get_similar_albums(album_id: int | str, country_code: str, *, limit: int = None, offset: int = None) dict[str, Any] [source]#
Album API > Get similar albums for the given album: Retrieve a list of albums similar to the given album.
- Parameters:
- album_idint or str
TIDAL album ID.
Examples:
251380836
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.- limitint, keyword-only, optional
Page size.
Example:
10
.- offsetint, keyword-only, optional
Pagination offset (in number of items).
Example:
0
.
- Returns:
- album_idsdict
A dictionary containing TIDAL album IDs for similar albums and metadata for the returned results.
Sample response
{ "data": [ { "resource": { "id": <str> } } ], "metadata": { "total": <int> } }
- get_similar_artists(artist_id: int | str, country_code: str, *, limit: int = None, offset: int = None) dict[str, Any] [source]#
Artist API > Get similar artists for the given artist: Retrieve a list of artists similar to the given artist.
- Parameters:
- artist_idint or str
TIDAL artist ID.
Example:
1566
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.- limitint, keyword-only, optional
Page size.
Example:
10
.- offsetint, keyword-only, optional
Pagination offset (in number of items).
Example:
0
.
- Returns:
- artist_idsdict
A dictionary containing TIDAL artist IDs for similar albums and metadata for the returned results.
Sample response
{ "data": [ { "resource": { "id": <str> } } ], "metadata": { "total": <int> } }
- get_similar_tracks(track_id: int | str, country_code: str, *, limit: int = None, offset: int = None) dict[str, Any] [source]#
Track API > Get similar tracks for the given track: Retrieve a list of tracks similar to the given track.
- Parameters:
- track_idint or str
TIDAL track ID.
Example:
251380837
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.- limitint, keyword-only, optional
Page size.
Example:
10
.- offsetint, keyword-only, optional
Pagination offset (in number of items).
Example:
0
.
- Returns:
- track_idsdict
A dictionary containing TIDAL track IDs for similar albums and metadata for the returned results.
Sample response
{ "data": [ { "resource": { "id": <str> } } ], "metadata": { "total": <int> } }
- get_track(track_id: int | str, country_code: str) dict[str, Any] [source]#
Track API > Get single track: Retrieve track details by TIDAL track ID.
- Parameters:
- track_idint or str
TIDAL track ID.
Example:
251380837
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.
- Returns:
- trackdict
TIDAL catalog information for a single track.
Sample response
{ "artifactType": "track", "id": <str>, "title": <str>, "artists": [ { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ], "main": <bool> } ], "album": { "id": <str>, "title": <str>, "imageCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "videoCover": [ { "url": <str>, "width": <int>, "height": <int> } ] }, "duration": <int>, "trackNumber": <int>, "volumeNumber": <int>, "isrc": <int>, "copyright": <int>, "mediaMetadata": { "tags": [<str>] }, "properties": { "content": [<str>] } }
- get_tracks(track_ids: int | str | list[int | str], country_code: str) dict[str, Any] [source]#
Album API > Get multiple tracks: Retrieve a list of track details by TIDAL track IDs.
- Parameters:
- track_idsint, str, or list
TIDAL track ID(s).
Examples:
"251380837,251380838"
or[251380837, 251380838]
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.
- Returns:
- tracksdict
A dictionary containing TIDAL catalog information for multiple tracks and metadata for the returned results.
Sample response
{ "data": [ { "resource": { "artifactType": "track", "id": <str>, "title": <str>, "artists": [ { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ], "main": <bool> } ], "album": { "id": <str>, "title": <str>, "imageCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "videoCover": [ { "url": <str>, "width": <int>, "height": <int> } ] }, "duration": <int>, "trackNumber": <int>, "volumeNumber": <int>, "isrc": <int>, "copyright": <int>, "mediaMetadata": { "tags": [<str>] }, "properties": { "content": [<str>] } }, "id": <str>, "status": 200, "message": "success" } ], "metadata": { "requested": <int>, "success": <int>, "failure": <int> } }
- get_tracks_by_isrc(isrc: str, country_code: str, limit: int = None, offset: int = None) dict[str, Any] [source]#
Track API > Get tracks by ISRC: Retrieve a list of track details by ISRC.
- Parameters:
- isrcstr
Valid ISRC code (usually comprises 12 alphanumeric characters).
Example:
"USSM12209515"
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.- limitint, optional
Page size.
Example:
10
.- offsetint, optional
Pagination offset (in number of items).
Example:
0
.
- Returns:
- tracksdict
A dictionary containing TIDAL catalog information for tracks with the specified ISRC and metadata for the returned results.
Sample response
{ "data": [ { "resource": { "artifactType": "track", "id": <str>, "title": <str>, "artists": [ { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ], "main": <bool> } ], "album": { "id": <str>, "title": <str>, "imageCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "videoCover": [ { "url": <str>, "width": <int>, "height": <int> } ] }, "duration": <int>, "trackNumber": <int>, "volumeNumber": <int>, "isrc": <int>, "copyright": <int>, "mediaMetadata": { "tags": [<str>] }, "properties": { "content": [<str>] } }, "id": <str>, "status": 200, "message": "success" } ], "metadata": { "requested": <int>, "success": <int>, "failure": <int> } }
- get_video(video_id: int | str, country_code: str) dict[str, Any] [source]#
Video API > Get single video: Retrieve video details by TIDAL video ID.
- Parameters:
- video_idint or str
TIDAL video ID.
Example:
75623239
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.
- Returns:
- videodict
TIDAL catalog information for a single video.
Sample response
{ "artifactType": "video", "id": <str>, "title": <str>, "image": [ { "url": <str>, "width": <int>, "height": <int> } ], "releaseDate": <str>, "artists": [ { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ], "main": <bool> } ], "duration": <int>, "trackNumber": <int>, "volumeNumber": <int>, "isrc": <str>, "properties": { "content": [<str>] } }
- get_videos(video_ids: int | str | list[int | str], country_code: str) list[dict[str, Any]] [source]#
Album API > Get multiple videos: Retrieve a list of video details by TIDAL video IDs.
- Parameters:
- video_idsint, str, or list
TIDAL video ID(s).
Examples:
"59727844,75623239"
or[59727844, 75623239]
.- country_codestr
ISO 3166-1 alpha-2 country code.
Example:
"US"
.
- Returns:
- videosdict
A dictionary containing TIDAL catalog information for multiple videos and metadata for the returned results.
Sample response
{ "data": [ { "artifactType": "video", "id": <str>, "title": <str>, "image": [ { "url": <str>, "width": <int>, "height": <int> } ], "releaseDate": <str>, "artists": [ { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ], "main": <bool> } ], "duration": <int>, "trackNumber": <int>, "volumeNumber": <int>, "isrc": <str>, "properties": { "content": [<str>] } } ], "metadata": { "requested": <int>, "success": <int>, "failure": <int> } }
- search(query: str, country_code: str, *, type: str = None, limit: int = None, offset: int = None, popularity: str = None) dict[str, list[dict[str, Any]]] [source]#
Search API > Search for catalog items: Search for albums, artists, tracks, and videos.
- Parameters:
- querystr
Search query.
Example:
"Beyoncé"
.- country_code: `str`
ISO 3166-1 alpha-2 country code.
Example:
"US"
.- typestr, keyword-only, optional
Target search type. Searches for all types if not specified.
Valid values:
"ALBUMS"
,"ARTISTS"
,"TRACKS"
,"VIDEOS"
.- limitint, keyword-only, optional
Page size.
Example:
10
.- offsetint, keyword-only, optional
Pagination offset (in number of items).
Example:
0
.- popularitystr, keyword-only, optional
Specify which popularity type to apply for query result.
"WORLDWIDE"
is used if not specified.Valid values:
"WORLDWIDE"
or"COUNTRY"
.
- Returns:
- resultsdict
A dictionary containing TIDAL catalog information for albums, artists, tracks, and videos matching the search query, and metadata for the returned results.
Sample response
{ "albums": [ { "resource": { "id": <str>, "barcodeId": <str>, "title": <str>, "artists": [ { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ], "main": <bool> } ], "duration": <int>, "releaseDate": <str>, "imageCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "videoCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "numberOfVolumes": <int>, "numberOfTracks": <int>, "numberOfVideos": <int>, "type": "ALBUM", "copyright": <str>, "mediaMetadata": { "tags": [<str>] }, "properties": { "content": [<str>] } }, "id": <str>, "status": 200, "message": "success" } ], "artists": [ { "resource": { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ] }, "id": <str>, "status": 200, "message": "success" } ], "tracks": [ { "resource": { "artifactType": "track", "id": <str>, "title": <str>, "artists": [ { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ], "main": <bool> } ], "album": { "id": <str>, "title": <str>, "imageCover": [ { "url": <str>, "width": <int>, "height": <int> } ], "videoCover": [ { "url": <str>, "width": <int>, "height": <int> } ] }, "duration": <int>, "trackNumber": <int>, "volumeNumber": <int>, "isrc": <int>, "copyright": <int>, "mediaMetadata": { "tags": [<str>] }, "properties": { "content": [<str>] } }, "id": <str>, "status": 200, "message": "success" } ], "videos": [ { "artifactType": "video", "id": <str>, "title": <str>, "image": [ { "url": <str>, "width": <int>, "height": <int> } ], "releaseDate": <str>, "artists": [ { "id": <str>, "name": <str>, "picture": [ { "url": <str>, "width": <int>, "height": <int> } ], "main": <bool> } ], "duration": <int>, "trackNumber": <int>, "volumeNumber": <int>, "isrc": <str>, "properties": { "content": [<str>] } } ] }
- set_access_token(access_token: str = None, *, expiry: str | datetime = None) None [source]#
Set the TIDAL API access token.
- Parameters:
- access_tokenstr, optional
Access token. If not provided, an access token is obtained using an OAuth 2.0 authorization flow.
- expirystr or datetime.datetime, keyword-only, optional
Access token expiry timestamp in the ISO 8601 format
%Y-%m-%dT%H:%M:%SZ
. If provided, the user will be reauthenticated using the default authorization flow (if possible) when access_token expires.
- set_flow(flow: str, *, client_id: str = None, client_secret: str = None, save: bool = True) None [source]#
Set the authorization flow.
- Parameters:
- flowstr
Authorization flow.
Valid values:
"client_credentials"
for the client credentials flow.
- client_idstr, keyword-only, optional
Client ID. Required for all authorization flows.
- client_secretstr, keyword-only, optional
Client secret. Required for all authorization flows.
- savebool, keyword-only, default:
True
Determines whether to save the newly obtained access tokens and their associated properties to the Minim configuration file.