LSEG Data Library for Python

endpoint_request.Definition object

The endpoint_request.Definition object defines the wrapper around the data delivery mechanism of the LSEG Data Platform (formerly Refinitiv Data Platform).

Module

lseg.data.delivery

Syntax

endpoint_request.Definition(url, method, path_parameters, query_parameters, header_parameters, body_parameters)

Parameters

Value Description Data type Optional Default value
url The URL for the API endpoint. str No -
method The method used for the HTTP request. str, RequestMethod Yes None
path_parameters Parameters that can be added to the endpoint URL. dict Yes None
query_parameters The query parameters for the HTTP request. For example:
"universe"
dict Yes None
header_parameters The header parameters for the HTTP request. dict Yes None
boby_parameters The body parameters for the HTTP request. dict, list[dict] Yes None

Returned value

endpoint_request.Definition object

Usage

The following example demonstrates how to create the wrapper to retrieve the available information on environmental, social, and governance (ESG) for IBM.N:

from lseg.data.delivery import endpoint_request
from lseg.data.delivery.endpoint_request import RequestMethod

# define API endpoint URL
esg_url = 'https://api.refinitiv.com/data/environmental-social-governance/v2/views/basic'

definition = endpoint_request.Definition(
        url=esg_url,
        method=RequestMethod.GET,
        query_parameters={"universe": "IBM.N"}
)

RequestMethod

124 words (0:39 mins)