Skip to content

Latest commit

 

History

History
1064 lines (713 loc) · 37.3 KB

TracksApi.md

File metadata and controls

1064 lines (713 loc) · 37.3 KB

pyaudius.TracksApi

All URIs are relative to https://discoveryprovider.audius.co/v1

Method HTTP request Description
download_track GET /tracks/{track_id}/download Download the original or MP3 file of a track
get_bulk_tracks GET /tracks
get_track GET /tracks/{track_id}
get_track_access_info GET /tracks/{track_id}/access-info
get_track_stems GET /tracks/{track_id}/stems
get_track_top_listeners GET /tracks/{track_id}/top_listeners
get_trending_tracks GET /tracks/trending
get_underground_trending_tracks GET /tracks/trending/underground
inspect_track GET /tracks/{track_id}/inspect Inspects the details of the file for a track
search_tracks GET /tracks/search
stream_track GET /tracks/{track_id}/stream Get the streamable MP3 file of a track
track_comment_count GET /tracks/{track_id}/comment_count
track_comment_notification_setting GET /tracks/{track_id}/comment_notification_setting
track_comments GET /tracks/{track_id}/comments

download_track

download_track(track_id, user_id=user_id, user_signature=user_signature, user_data=user_data, nft_access_signature=nft_access_signature, original=original, filename=filename)

Download the original or MP3 file of a track

Download an original or mp3 track

Example

import pyaudius
from pyaudius.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://discoveryprovider.audius.co/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyaudius.Configuration(
    host = "https://discoveryprovider.audius.co/v1"
)


# Enter a context with an instance of the API client
with pyaudius.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyaudius.TracksApi(api_client)
    track_id = 'track_id_example' # str | A Track ID
    user_id = 'user_id_example' # str | The user ID of the user making the request (optional)
    user_signature = 'user_signature_example' # str | Optional - signature from the requesting user's wallet.         This is needed to authenticate the user and verify access in case the track is gated. (optional)
    user_data = 'user_data_example' # str | Optional - data which was used to generate the optional signature argument. (optional)
    nft_access_signature = 'nft_access_signature_example' # str | Optional - nft access signature for this track which was previously generated by a registered DN.         We perform checks on it and pass it through to CN. (optional)
    original = False # bool | Optional - true if downloading original file (optional) (default to False)
    filename = 'filename_example' # str | Optional - name of file to download. If not provided, defaults to track original filename or title. (optional)

    try:
        # Download the original or MP3 file of a track
        api_instance.download_track(track_id, user_id=user_id, user_signature=user_signature, user_data=user_data, nft_access_signature=nft_access_signature, original=original, filename=filename)
    except Exception as e:
        print("Exception when calling TracksApi->download_track: %s\n" % e)

Parameters

Name Type Description Notes
track_id str A Track ID
user_id str The user ID of the user making the request [optional]
user_signature str Optional - signature from the requesting user's wallet. This is needed to authenticate the user and verify access in case the track is gated. [optional]
user_data str Optional - data which was used to generate the optional signature argument. [optional]
nft_access_signature str Optional - nft access signature for this track which was previously generated by a registered DN. We perform checks on it and pass it through to CN. [optional]
original bool Optional - true if downloading original file [optional] [default to False]
filename str Optional - name of file to download. If not provided, defaults to track original filename or title. [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Success -
216 Partial content -
400 Bad request -
416 Content range invalid -
500 Server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_bulk_tracks

TracksResponse get_bulk_tracks(permalink=permalink, id=id)

Gets a list of tracks using their IDs or permalinks

Example

import pyaudius
from pyaudius.models.tracks_response import TracksResponse
from pyaudius.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://discoveryprovider.audius.co/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyaudius.Configuration(
    host = "https://discoveryprovider.audius.co/v1"
)


# Enter a context with an instance of the API client
with pyaudius.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyaudius.TracksApi(api_client)
    permalink = ['permalink_example'] # List[str] | The permalink of the track(s) (optional)
    id = ['id_example'] # List[str] | The ID of the track(s) (optional)

    try:
        api_response = api_instance.get_bulk_tracks(permalink=permalink, id=id)
        print("The response of TracksApi->get_bulk_tracks:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TracksApi->get_bulk_tracks: %s\n" % e)

Parameters

Name Type Description Notes
permalink List[str] The permalink of the track(s) [optional]
id List[str] The ID of the track(s) [optional]

Return type

TracksResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad request -
500 Server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_track

TrackResponse get_track(track_id)

Gets a track by ID

Example

import pyaudius
from pyaudius.models.track_response import TrackResponse
from pyaudius.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://discoveryprovider.audius.co/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyaudius.Configuration(
    host = "https://discoveryprovider.audius.co/v1"
)


# Enter a context with an instance of the API client
with pyaudius.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyaudius.TracksApi(api_client)
    track_id = 'track_id_example' # str | A Track ID

    try:
        api_response = api_instance.get_track(track_id)
        print("The response of TracksApi->get_track:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TracksApi->get_track: %s\n" % e)

Parameters

Name Type Description Notes
track_id str A Track ID

Return type

TrackResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad request -
500 Server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_track_access_info

AccessInfoResponse get_track_access_info(track_id, user_id=user_id)

Gets the information necessary to access the track and what access the given user has.

Example

import pyaudius
from pyaudius.models.access_info_response import AccessInfoResponse
from pyaudius.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://discoveryprovider.audius.co/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyaudius.Configuration(
    host = "https://discoveryprovider.audius.co/v1"
)


# Enter a context with an instance of the API client
with pyaudius.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyaudius.TracksApi(api_client)
    track_id = 'track_id_example' # str | A Track ID
    user_id = 'user_id_example' # str | The user ID of the user making the request (optional)

    try:
        api_response = api_instance.get_track_access_info(track_id, user_id=user_id)
        print("The response of TracksApi->get_track_access_info:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TracksApi->get_track_access_info: %s\n" % e)

Parameters

Name Type Description Notes
track_id str A Track ID
user_id str The user ID of the user making the request [optional]

Return type

AccessInfoResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_track_stems

StemsResponse get_track_stems(track_id)

Get the remixable stems of a track

Example

import pyaudius
from pyaudius.models.stems_response import StemsResponse
from pyaudius.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://discoveryprovider.audius.co/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyaudius.Configuration(
    host = "https://discoveryprovider.audius.co/v1"
)


# Enter a context with an instance of the API client
with pyaudius.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyaudius.TracksApi(api_client)
    track_id = 'track_id_example' # str | A Track ID

    try:
        api_response = api_instance.get_track_stems(track_id)
        print("The response of TracksApi->get_track_stems:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TracksApi->get_track_stems: %s\n" % e)

Parameters

Name Type Description Notes
track_id str A Track ID

Return type

StemsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_track_top_listeners

TopListener get_track_top_listeners(track_id, offset=offset, limit=limit, user_id=user_id)

Get the users that have listened to a track the most

Example

import pyaudius
from pyaudius.models.top_listener import TopListener
from pyaudius.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://discoveryprovider.audius.co/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyaudius.Configuration(
    host = "https://discoveryprovider.audius.co/v1"
)


# Enter a context with an instance of the API client
with pyaudius.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyaudius.TracksApi(api_client)
    track_id = 'track_id_example' # str | A Track ID
    offset = 56 # int | The number of items to skip. Useful for pagination (page number * limit) (optional)
    limit = 56 # int | The number of items to fetch (optional)
    user_id = 'user_id_example' # str | The user ID of the user making the request (optional)

    try:
        api_response = api_instance.get_track_top_listeners(track_id, offset=offset, limit=limit, user_id=user_id)
        print("The response of TracksApi->get_track_top_listeners:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TracksApi->get_track_top_listeners: %s\n" % e)

Parameters

Name Type Description Notes
track_id str A Track ID
offset int The number of items to skip. Useful for pagination (page number * limit) [optional]
limit int The number of items to fetch [optional]
user_id str The user ID of the user making the request [optional]

Return type

TopListener

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad request -
500 Server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_trending_tracks

TracksResponse get_trending_tracks(genre=genre, time=time)

Gets the top 100 trending (most popular) tracks on Audius

Example

import pyaudius
from pyaudius.models.tracks_response import TracksResponse
from pyaudius.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://discoveryprovider.audius.co/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyaudius.Configuration(
    host = "https://discoveryprovider.audius.co/v1"
)


# Enter a context with an instance of the API client
with pyaudius.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyaudius.TracksApi(api_client)
    genre = 'genre_example' # str | Filter trending to a specified genre (optional)
    time = 'time_example' # str | Calculate trending over a specified time range (optional)

    try:
        api_response = api_instance.get_trending_tracks(genre=genre, time=time)
        print("The response of TracksApi->get_trending_tracks:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TracksApi->get_trending_tracks: %s\n" % e)

Parameters

Name Type Description Notes
genre str Filter trending to a specified genre [optional]
time str Calculate trending over a specified time range [optional]

Return type

TracksResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad request -
500 Server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_underground_trending_tracks

TracksResponse get_underground_trending_tracks(offset=offset, limit=limit)

Gets the top 100 trending underground tracks on Audius

Example

import pyaudius
from pyaudius.models.tracks_response import TracksResponse
from pyaudius.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://discoveryprovider.audius.co/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyaudius.Configuration(
    host = "https://discoveryprovider.audius.co/v1"
)


# Enter a context with an instance of the API client
with pyaudius.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyaudius.TracksApi(api_client)
    offset = 56 # int | The number of items to skip. Useful for pagination (page number * limit) (optional)
    limit = 56 # int | The number of items to fetch (optional)

    try:
        api_response = api_instance.get_underground_trending_tracks(offset=offset, limit=limit)
        print("The response of TracksApi->get_underground_trending_tracks:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TracksApi->get_underground_trending_tracks: %s\n" % e)

Parameters

Name Type Description Notes
offset int The number of items to skip. Useful for pagination (page number * limit) [optional]
limit int The number of items to fetch [optional]

Return type

TracksResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

inspect_track

TrackInspect inspect_track(track_id, original=original)

Inspects the details of the file for a track

Inspect a track

Example

import pyaudius
from pyaudius.models.track_inspect import TrackInspect
from pyaudius.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://discoveryprovider.audius.co/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyaudius.Configuration(
    host = "https://discoveryprovider.audius.co/v1"
)


# Enter a context with an instance of the API client
with pyaudius.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyaudius.TracksApi(api_client)
    track_id = 'track_id_example' # str | A Track ID
    original = False # bool | Optional - if set to true inspects the original quality file (optional) (default to False)

    try:
        # Inspects the details of the file for a track
        api_response = api_instance.inspect_track(track_id, original=original)
        print("The response of TracksApi->inspect_track:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TracksApi->inspect_track: %s\n" % e)

Parameters

Name Type Description Notes
track_id str A Track ID
original bool Optional - if set to true inspects the original quality file [optional] [default to False]

Return type

TrackInspect

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad request -
500 Server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

search_tracks

TrackSearch search_tracks(query=query, genre=genre, sort_method=sort_method, mood=mood, only_downloadable=only_downloadable, include_purchaseable=include_purchaseable, is_purchaseable=is_purchaseable, has_downloads=has_downloads, key=key, bpm_min=bpm_min, bpm_max=bpm_max)

Search for a track or tracks

Example

import pyaudius
from pyaudius.models.track_search import TrackSearch
from pyaudius.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://discoveryprovider.audius.co/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyaudius.Configuration(
    host = "https://discoveryprovider.audius.co/v1"
)


# Enter a context with an instance of the API client
with pyaudius.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyaudius.TracksApi(api_client)
    query = 'query_example' # str | The search query (optional)
    genre = ['genre_example'] # List[str] | The genres to filter by (optional)
    sort_method = 'sort_method_example' # str | The sort method (optional)
    mood = ['mood_example'] # List[str] | The moods to filter by (optional)
    only_downloadable = 'false' # str | Return only downloadable tracks (optional) (default to 'false')
    include_purchaseable = 'include_purchaseable_example' # str | Whether or not to include purchaseable content (optional)
    is_purchaseable = 'is_purchaseable_example' # str | Only include purchaseable tracks and albums in the track and album results (optional)
    has_downloads = 'has_downloads_example' # str | Only include tracks that have downloads in the track results (optional)
    key = ['key_example'] # List[str] | Only include tracks that match the musical key (optional)
    bpm_min = 'bpm_min_example' # str | Only include tracks that have a bpm greater than or equal to (optional)
    bpm_max = 'bpm_max_example' # str | Only include tracks that have a bpm less than or equal to (optional)

    try:
        api_response = api_instance.search_tracks(query=query, genre=genre, sort_method=sort_method, mood=mood, only_downloadable=only_downloadable, include_purchaseable=include_purchaseable, is_purchaseable=is_purchaseable, has_downloads=has_downloads, key=key, bpm_min=bpm_min, bpm_max=bpm_max)
        print("The response of TracksApi->search_tracks:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TracksApi->search_tracks: %s\n" % e)

Parameters

Name Type Description Notes
query str The search query [optional]
genre List[str] The genres to filter by [optional]
sort_method str The sort method [optional]
mood List[str] The moods to filter by [optional]
only_downloadable str Return only downloadable tracks [optional] [default to 'false']
include_purchaseable str Whether or not to include purchaseable content [optional]
is_purchaseable str Only include purchaseable tracks and albums in the track and album results [optional]
has_downloads str Only include tracks that have downloads in the track results [optional]
key List[str] Only include tracks that match the musical key [optional]
bpm_min str Only include tracks that have a bpm greater than or equal to [optional]
bpm_max str Only include tracks that have a bpm less than or equal to [optional]

Return type

TrackSearch

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad request -
500 Server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

stream_track

StreamUrlResponse stream_track(track_id, user_id=user_id, preview=preview, user_signature=user_signature, user_data=user_data, nft_access_signature=nft_access_signature, skip_play_count=skip_play_count, api_key=api_key, skip_check=skip_check, no_redirect=no_redirect)

Get the streamable MP3 file of a track

Stream an mp3 track This endpoint accepts the Range header for streaming. https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests

Example

import pyaudius
from pyaudius.models.stream_url_response import StreamUrlResponse
from pyaudius.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://discoveryprovider.audius.co/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyaudius.Configuration(
    host = "https://discoveryprovider.audius.co/v1"
)


# Enter a context with an instance of the API client
with pyaudius.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyaudius.TracksApi(api_client)
    track_id = 'track_id_example' # str | A Track ID
    user_id = 'user_id_example' # str | The user ID of the user making the request (optional)
    preview = False # bool | Optional - true if streaming track preview (optional) (default to False)
    user_signature = 'user_signature_example' # str | Optional - signature from the requesting user's wallet.         This is needed to authenticate the user and verify access in case the track is gated. (optional)
    user_data = 'user_data_example' # str | Optional - data which was used to generate the optional signature argument. (optional)
    nft_access_signature = 'nft_access_signature_example' # str | Optional - gated content signature for this track which was previously generated by a registered DN.         We perform checks on it and pass it through to CN. (optional)
    skip_play_count = False # bool | Optional - boolean that disables tracking of play counts. (optional) (default to False)
    api_key = 'api_key_example' # str | Optional - API key for third party apps. This is required for tracks that only allow specific API keys. (optional)
    skip_check = True # bool | Optional - POC to skip node 'double dip' health check (optional)
    no_redirect = True # bool | Optional - If true will not return a 302 and instead will return the stream url in JSON (optional)

    try:
        # Get the streamable MP3 file of a track
        api_response = api_instance.stream_track(track_id, user_id=user_id, preview=preview, user_signature=user_signature, user_data=user_data, nft_access_signature=nft_access_signature, skip_play_count=skip_play_count, api_key=api_key, skip_check=skip_check, no_redirect=no_redirect)
        print("The response of TracksApi->stream_track:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TracksApi->stream_track: %s\n" % e)

Parameters

Name Type Description Notes
track_id str A Track ID
user_id str The user ID of the user making the request [optional]
preview bool Optional - true if streaming track preview [optional] [default to False]
user_signature str Optional - signature from the requesting user's wallet. This is needed to authenticate the user and verify access in case the track is gated. [optional]
user_data str Optional - data which was used to generate the optional signature argument. [optional]
nft_access_signature str Optional - gated content signature for this track which was previously generated by a registered DN. We perform checks on it and pass it through to CN. [optional]
skip_play_count bool Optional - boolean that disables tracking of play counts. [optional] [default to False]
api_key str Optional - API key for third party apps. This is required for tracks that only allow specific API keys. [optional]
skip_check bool Optional - POC to skip node 'double dip' health check [optional]
no_redirect bool Optional - If true will not return a 302 and instead will return the stream url in JSON [optional]

Return type

StreamUrlResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
216 Partial content -
400 Bad request -
416 Content range invalid -
500 Server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

track_comment_count

TrackCommentCountResponse track_comment_count(track_id, user_id=user_id)

Get the comment count for a track

Example

import pyaudius
from pyaudius.models.track_comment_count_response import TrackCommentCountResponse
from pyaudius.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://discoveryprovider.audius.co/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyaudius.Configuration(
    host = "https://discoveryprovider.audius.co/v1"
)


# Enter a context with an instance of the API client
with pyaudius.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyaudius.TracksApi(api_client)
    track_id = 'track_id_example' # str | A Track ID
    user_id = 'user_id_example' # str | The user ID of the user making the request (optional)

    try:
        api_response = api_instance.track_comment_count(track_id, user_id=user_id)
        print("The response of TracksApi->track_comment_count:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TracksApi->track_comment_count: %s\n" % e)

Parameters

Name Type Description Notes
track_id str A Track ID
user_id str The user ID of the user making the request [optional]

Return type

TrackCommentCountResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad request -
500 Server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

track_comment_notification_setting

TrackCommentNotificationResponse track_comment_notification_setting(track_id, user_id=user_id)

Get the comment notification setting for a track

Example

import pyaudius
from pyaudius.models.track_comment_notification_response import TrackCommentNotificationResponse
from pyaudius.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://discoveryprovider.audius.co/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyaudius.Configuration(
    host = "https://discoveryprovider.audius.co/v1"
)


# Enter a context with an instance of the API client
with pyaudius.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyaudius.TracksApi(api_client)
    track_id = 'track_id_example' # str | A Track ID
    user_id = 'user_id_example' # str | The user ID of the user making the request (optional)

    try:
        api_response = api_instance.track_comment_notification_setting(track_id, user_id=user_id)
        print("The response of TracksApi->track_comment_notification_setting:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TracksApi->track_comment_notification_setting: %s\n" % e)

Parameters

Name Type Description Notes
track_id str A Track ID
user_id str The user ID of the user making the request [optional]

Return type

TrackCommentNotificationResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad request -
500 Server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

track_comments

TrackCommentsResponse track_comments(track_id, offset=offset, limit=limit, user_id=user_id, sort_method=sort_method)

Get a list of comments for a track

Example

import pyaudius
from pyaudius.models.track_comments_response import TrackCommentsResponse
from pyaudius.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://discoveryprovider.audius.co/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyaudius.Configuration(
    host = "https://discoveryprovider.audius.co/v1"
)


# Enter a context with an instance of the API client
with pyaudius.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pyaudius.TracksApi(api_client)
    track_id = 'track_id_example' # str | A Track ID
    offset = 56 # int | The number of items to skip. Useful for pagination (page number * limit) (optional)
    limit = 56 # int | The number of items to fetch (optional)
    user_id = 'user_id_example' # str | The user ID of the user making the request (optional)
    sort_method = top # str | The sort method (optional) (default to top)

    try:
        api_response = api_instance.track_comments(track_id, offset=offset, limit=limit, user_id=user_id, sort_method=sort_method)
        print("The response of TracksApi->track_comments:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TracksApi->track_comments: %s\n" % e)

Parameters

Name Type Description Notes
track_id str A Track ID
offset int The number of items to skip. Useful for pagination (page number * limit) [optional]
limit int The number of items to fetch [optional]
user_id str The user ID of the user making the request [optional]
sort_method str The sort method [optional] [default to top]

Return type

TrackCommentsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad request -
500 Server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]